Migrating Wordpress from sub-domain to root - mysql

I am about to start building a new site in Wordpress on the same domain as the old site. I need the old site to stay live until the new one is launched and I also need to develop online.
What is the best way to go about this? Should I create a subdomain or subfolder?
How would I go about migrating the Wordpress site & database from this testing area to the root on completion?
Thanks.

This depends on your hosting environment.
If you have a Cpanel hosting account you can create a subdomain through that, which actually creates a subfolder. This is known as a virtual subdomain.
So you can access the test site by going to www.yourdomain.com/subfolder or www.subfolder.yourdomain.com
This is good because it doesn't lock you in either way.
As to migrating your site I would back up your old sites files locally (via FTP) and your database via PHPMYADMIN. Then copy your development site via FTP into the root directory and update your database via PHPMYADMIN

With WordPress you can create either a sub-domain like http://blog.mysitename.com or a sub-folder like http://mysitename.com/blog/ - either one WordPress will support - you just need to make your settings in your wp_options table (usually rows w/ ID's 1 & 39) point to the appropriate domain you've set up. It just kind of depends on what kind of control you have over your server, but from the sound of it, you should have enough to do both.
For your database - you can actually point to the same database & just pre-pend your table names with some sort of prefix to distinguish between your existing site & your new site. WordPress by default prepends your table names w/ "wp_", so for example "wp_TABLE_NAME" with the all cap's being replaced w/ the actual name of the WordPress table (like your wp_options table). Or, you can set up a entirely new database too & it wont matter.
The key is when the WordPress site is ready to go live, you'll need to point the main domain to the new site & then change the wp_options table to use the new URL.

You may need to change .htaccess, too, unless Cpanel (if used) handles that: Changing The Site URL « WordPress Codex and Moving WordPress « WordPress Codex.

Related

Multiple Website with Single Database and Different urls WordPress?

I was looking to find a solution for making clone websites of my existing WordPress website. the thing is I want to make clones of the website so if one of them will somehow get down the others will be Live. For Example The Piratebay.com they have a lot of clone sites and I you would upload a torrent to one site all of them will have the same torrent available, this is just for example purposes. I want to make a clone of my website so if I add a new post to my any clone website or the original all of the websites will have the same post available on it. For sure they will have their own domain name. The website will use MySql as the form of database. I have searched all over the internet and on StackOverflow as well and couldn't fine a solutuion
Use the same Cloud MySQL database (e.g. Googles Cloud SQL) for all websites. Install wordpress on the first domain and then just copy the wordpress folder to the other destinations (or modify the wordpress-configuration at the other destinations).
Don't use absolute paths for images in your posts etc. (not http://example.com/something/image.jpg).

Big problems with shared SugarCRM database

Here is my situation:
I have two hosting sites with a domain each, each with Sugarcrm infrastructure. I started with one hosting site and started creating a database through Sugar. Then, I started a SECOND hosting site with a new domain, and I believe I have linked the two databases accidentally. If I change a value in the database on one site, it gets reflected on the other.
So, the original domain/hosting site is expiring, and I would like to move the SQL database over to the new site permanently. I have made a backup of the database from the original site and have it on my desktop.
My questions:
1. Can I just drag the SQL file into the new site (I use FileZilla) database location and everything will be OK?
2. I cannot find the location in file manager of the new site where I would drag this database into!? I use goddady, and the newer site uses cpanel.
**Other problem: I have accidentally upgraded the newer sites SugarCrm version, and have created huge problems because the original site is not upgraded, and the sites do not like that very much as the database is shared. There original site is unreachable (it says you cannot use the newer version database with the old Sugar version), and the new site has visible problems but is workable.
As you can tell, I am a totally inexperienced n00b, and am learning as I go. I have spent weeks setting up this database, and would appreciate any help on maintaining its integrity.
Thank you very much!
Tom
I'm assuming you're using MySQL for your database.
Unless your tables are all MyISAM tables, simply copying the database files won't work.
Whenever you want to move a MySQL database it's a good idea to dump the database, move that file over, then recreate the database. Read up on the mysqldump command.
If you're using Oracle or something else, I would think a similar technique would be desirable. Basically dump your database to a backup format that your database server can use to recreate your database. Don't just copy database files around.

Switching hosts, Moving databases, but having trouble

So I do mainly design-based work for a small company. Graphic/Web (more so advertising). I have maintained and updated their decent-sized website for awhile now, but now we are switching hosts.
I have been asked for passwords to the wordpress blog databases, as they don't have them (neither do I). With that, I was asked to check the web configurations and look for database connection strings with the passwords. If not we'll have to reset them. I can setup wordpress blogs, write HTML, CSS and overall design - but databases and backend stuff is not my forte.
Can someone give me an idea of what it is I should be looking for, and where?
You should find your database password in the WordPress configuration file, wp-config.php. This is usually located in the root of the site but it may have been moved outside the web root.
Can you gain access to the FTP? Assuming so, look for a file on the main area where you have wordpress called wp-config.php. You'll be able to find your db connection stuff in there.

Can a separate WordPress (same server) get posts from an existing one, but have different settings?

When developing WordPress themes for a site with a large amount of posts, how can I dynamically pull existing post data from the live version of the site onto my testing site? I already know about WordPress's export feature, but that's one-and-done, not dynamically queried.
Plan A:
Proposed Solution:
Create read-only user in live site's database
PRECAUTION: change test site's prefix from "wp_" to "test_"
Problems:
Settings (like current theme) on test site cannot be changed, thanks to read-only user
No posts found in "test_posts", even though I'd like it to search "wp_posts"
Is there an easier way or existing solution to avoid rewriting WordPress system files on the test site? I'd really rather not rewrite WordPress's database interface...
Similar: Linking themes across WP installations
just duplicate the DB, re-name and call DB in wp-config!

moving wordpress mu to another domain - sql statements

I'm assuming these instructions are for "normal" wordpress... will this work with wpmu or do i need to modify this? Is there anything i should watch for?
http://www.mydigitallife.info/2007/10/01/how-to-move-wordpress-blog-to-new-domain-or-location/
See Moving WordPress « WordPress Codex and WordPress Serialized PHP Search Replace Tool
The biggest issue you face is changing URLs in the database; and you will need to change these URLs in each of the individual databases that Multisite installs uses. Check out the find/replace tool linked above; it correctly deserializes/serializes data in the database. If you change URLs in a text database dump, or with SQL queries as in the link you listed in your question, you risk breaking data, such as theme options and widget settings.
1/09/2016 Note: WordPress MU doesn't exist anymore. MU was rolled into WordPress core in version 3.0.