what should be a simple WP migration

Web hosting discussion, programming, and shared and dedicated servers.
2 posts Page 1 of 1
by dcergo » Fri Mar 05, 2021 7:47 pm
I am not the actual owner of the situation noted here, just know more than he does... and I have all of his logins and passwords. I have shelled into his directories and poked around.

Trying to migrate a WP installation from one domain name to another, both hosted on Sonic, in parallel directories. Per WP:
https://wordpress.org/support/article/m ... e-and-urls

Tells me this:
1 Download your existing site files.
2 Export your database – go in to MySQL and export the database.
3 Move the backed up files and database into a new folder – somewhere safe – this is your site backup.
4 Log in to the site you want to move and go to Settings > General, then change the URLs. (ie from http://example.com/ to http://example.net ) – save the settings and expect to see a 404 page.
5 Download your site files again.
6 Export the database again.
7 Edit wp-config.php with the new server’s MySQL database name, user and password.
8 Upload the files.
9 Import the database on the new server.

This sounds simple enough. BUT... The DB named in the current wp_config.php file doesn't seem to exist. If I go to Member Tools and attempt to manipulate the DB (Manage -> dbname), the DB name shown is not the one listed in the wp-config.php file. The name via Member Tools is a DB that was a *previous* installation. I have no visibility to the DB supposedly being used by the current WP site. This makes me nervous about exporting/importing the DB.

Further, WP talks about needing to do a search and replace in the DB for the URL string. Hard to do if I can't see the DB.

Should this need to be this complicated? Why might I need to export and import the DB if the new site merely wants to use a new URL/domain name? The owner has done this more than once (or at least, had someone do it), and there are now 5 or 6 directories sitting next to each other, all with different DB names in their config files, different URLs to access them, and lots of confusion on my part.

Any help appreciated; thanks!
by joemuller » Tue Mar 09, 2021 12:17 pm
What probably happened is that the site was set up automatically with the Wordpress One Click Install option in Member Tools -- for those sites, the database is not listed as a service and cannot be managed with the mysqladmin web tool.

However, the database does exist with the username, password, and database name listed in wp-config.php like this:

Code: Select all

define('DB_NAME', 'username_oc_1');    // The name of the database
define('DB_USER', 'username_oc_1');     // Your MySQL username
define('DB_PASSWORD', 'Pa4sW0Rd'); // ...and password
define('DB_HOST', 'c.custsql.sonic.net');    // And which server it is hosted on.

You can perform a whole-database backup using either a Wordpress plugin (e.g. WP Database Backup) or using the 'mysqldump' command from shell.sonic.net. As long as you're backing up just the tables inside, the database name and credentials can be different on the new site (see wp-config.php to determine where Wordpress is looking for its database).

-- Joe M
Sonic System Operations
I'm a proud employee of Sonic.net! :-)
2 posts Page 1 of 1

Who is online

In total there are 9 users online :: 0 registered, 0 hidden and 9 guests (based on users active over the past 5 minutes)
Most users ever online was 999 on Mon May 10, 2021 1:02 am

Users browsing this forum: No registered users and 9 guests