Migrating Wordpress database to the new server.

Things that make it go whrrrrr
Post Reply
User avatar
Mike R
Site Admin
Posts: 64
Joined: Fri Jan 24, 2020 3:40 am

Migrating Wordpress database to the new server.

Post by Mike R »

Code: Select all

UPDATE wp\_options SET option\_value = replace(option\_value, 'oldurl.com', 'newurl.com') WHERE option\_name = 'home' OR option\_name = 'siteurl';UPDATE wp\_posts SET guid = replace(guid, 'oldurl.com','newurl.com');UPDATE wp\_posts SET post\_content = replace(post\_content, 'oldurl.com', 'newurl.com'); UPDATE wp\_postmeta SET meta\_value = replace(meta\_value,'oldurl.com','newurl.com')
I extrapolated the command below from the one above which was used to edit the tables in the wordpress database.

phpMyAdmin will give you hints as you type in the commands.

Code: Select all

UPDATE path SET strPath = REPLACE(strPath, '157.117.225.30', '157.117.225.31');
So the above command tells it to update the table "path" by performing a 'replace' function in the strPath column. Within the brackets is the specific information to change within that column.

I don't know yet if that is the extent of what needs to be changed within the database, but it's the only location I could find so far.

More will be revealed. :lol:
You Wouldn't Believe How Hard I Have to Work to be Lazy
User avatar
Mike R
Site Admin
Posts: 64
Joined: Fri Jan 24, 2020 3:40 am

Re: Migrating Wordpress database to the new server.

Post by Mike R »

All that above is balderdash!!!

First... commit to doing it regardless of the pain.
On Linux system setup hosts file via

Code: Select all

sudo nano /etc/hosts
point URL to appropriate IP address on you local network

On the Router:

Install DNS server and create a Mater Zone using the Domain Name you want to be used to access the new server.
The Master DNS server is the same IP as the new server, seeing as it will have all the files for everything to do with that domain.

On the new server:

I had to go to account.synology.com to release the QuickConnect and DNS names I had already set up beforehand.
Once these are released...
Begin setting up DNS on the new server.
Under External Access on the Advanced tab set up hostname and the different ports you want for DSM access so they are different than the default.
On the DDNS tabe set up the same name with whatever provider you want.
Check off "Get a certificat from Let's Encrypt and set it as default".
On the QuickConnect tab set up the access name you want to use.
Test the connection.

Now your NAS is accessible via URL from you home network as well as the internet.

Set up Wordpress.
Go to the old server and compress all the files in the site folder.
While that grinds away,...
Goto the new server and install phpMyAdmin - which installs WebStation.
If you need to, install Apache 2.2 and 2.4, as well as PHP 7.4
Log into phpMyAdmin as root, and create the same username and password as found on the old server and give it all privileges.
Create a database with the same name.

Import the zip file from the old server into the root location of the /web folder.
Extract all the files. You may have to cut and paste everything one folder up. <-- learning required here.
Open the wp-config.php file with a text editor and check over the database name, username and password if they need changing.

Open WebStation and under Web Service Portal edit the Default Server with Apache 2.4 and PHP 7.4
Under Script Language Settings edit the PHP 7.4 profile under Extensions to enable all the ones that are needed. <-- learning required here re: needed extensions. Too many slows it down.
Save and close.

Now enter the site URL into a browser window and see your site on the new server
You Wouldn't Believe How Hard I Have to Work to be Lazy
Post Reply