Wordpress to Wordpress Port

Wordpress to Wordpress Port


Wordpress to Wordpress Port

OVERVIEW 

You will be doing the following: 

  1. Backup of the site (uploads, database, and themes) 

  2. Creating a new site on the new server  

  3. Configuring the new site 

  4. Adding a plugin 

  5. Testing 

  6. Changing DNS when complete.  

 

This usually takes 1-4 hours to complete (if all goes well). 

See Troubleshooting 

 

Backups 

Make backups of the following: 

  1. Wp-content/uploads (all) 

  2. Database 

  3. Themes 

 

I recommend making a folder on your desktop called "SITE BACKUPS" and making a separate folder inside it for your site, then putting these folders in that folder.  

 

To Make a Backup: 

You can use a plugin to make a backup of the site. The plugin "Updraft Plus" is the most popular. Here's a helpful article - https://elementor.com/blog/backup-wordpress/?gclid=CjwKCAiAjp6BBhAIEiwAkO9WulUZXvqJVboFz96r-dVFKA2lVHwcqoGNdxwHUzqCwL2J87XsqUvoDRoC_KwQAvD_BwE 

 

Make a full backup of your site and download it to your machine. 

 

 

Create New WP Site 

 

You'll first want to go into the Wordpress Sites Plesk and create a new domain. Sometimes you will want to do this as a virtstage site, others you can go directly to live. If you make this as a wordpress site please name your site: 

 

Sitename.wp-virtstage.com  

 

This will ensure you do not have to add anything in GoDaddy as there is a wildcard set up for this domain. 

 

If you are making this directly as a production site you will want to name it the URL that it will be once live. 

 

Install Wordpress 

 

Go to your Plesk installation, click "Wordpress" on the left toolbar, and then click "Install" to create a new Wordpress installation.  

 

 

This installation will create the typical folders and files for you, and create a database. However, since we already have the files and database we need, we'll be uploading all this after the domain in Plesk is created.  

 

Upload Old Site to New 

Once the domain and WP are created, we need to upload the old database and the files.  

 

Database 

Find the newly-created site's Database area in Plesk. Create a new database for this new site and relate it to the new site. Document its name, the user and password you create in Keeper - you'll want to save these for connecting later.  

 

Import Database 

Once the new database is created, click "PhpMyAdmin" for the NEW database. Import your old database into this one, wait for it to finish.  

Take note of the prefix on the new tables. Save this in Keeper 

Example: some WP sites only use "wp_" as a prefix, some use much longer strings. In my example, wp_sr2o9 used "uMT29D_" as a prefix.  
To find the prefix of the database you just imported, it is the string of characters before the table names. There is usually an underscore "_" before the table name. (Ex: wp_posts == "wp_" is the prefix, "posts" is the table name.) 

 

(Alana's Note: In plesk for me, the database is automatically created when I create the site; so when I go into the database area, I drop the tables in the database and the import the tables from the site I'm porting from. Then I need to take note of the table prefix from the old site, as it won't be the same as what the new site created). 

 

Update Connection Strings 

Once the DB is imported and you have your prefix, FTP into the new server and find the file wp_config.php. It is in the root of the website (usually under /httpdocs).  

 

(Alana's Note: You don't have to FTP in w. filezilla, you can access this through the Plesk file explorer.) 

 

Open this file: wp_config.php 

Right-click wp_config.php and click "View/Edit".  

 

Inside wp_config.php, change the following constants:  

 

DB_NAME 

DB_USER 

DB_PASSWORD 

 

from the Plesk-generated strings to the ones you just made with your new database.  

 

Example: New values within the quotes, old values in the comment on the same line. 

 

 

Next, update the $table_prefix variable in the wp_config.php file from the old value to the one in your new database. 

 

Example: new prefix in quotes, old prefix in the comment on the same line.  

 

Once done, save the file and re-upload (FileZilla will take care of this for you).  

 

Site Files 

If you haven't already done so, you will need to FTP the files you took from the old server and upload them to the new server. These files are things like 

  • Wp-content/uploads 

  • Wp-content/plugins 

  • Google files in root (site verifications etc) 

  • Other super-root files as needed (not common) 

 

Be sure they match the path  

 

NOTE ABOUT UPLOADED IMAGES/FILES: Take note of how BIG the files/folders you're uploading are. The server only usually has 50-80GB, and depending on the site you're porting, this may not be enough. We'll explore Blob storage next to keep this under control.  

 

 

Testing 

Once the database and file structure are completely ported, you can test this site before updating DNS using the Hosts File. (On Windows: download and/or open Hosts File Editor; on Mac: using terminal, enter sudo nano /etc/hosts to edit. ) 

(More information about Hosts file here: https://www.imore.com/how-edit-your-macs-hosts-file-and-why-you-would-want ) 

 

In the Hosts file, enter the IP of the server where you just ported your new site to. Set the hosts name to that site's domain. 

Note: you may have some trouble with SSL or www.; if you notice you keep getting redirected from non-www just add www. to the hosts file and it should solve it. Click past the "non-https" warning for now. 

 

Be sure to check the new entry and click Save. 

 

After adding, navigate to this site in your browser. If everything went well, you should see the site you just ported at this address.  

 

You should then log in to the site, update plugins as necessary, and make any other changes you need to make.  

 

Enable Blob Storage for Uploaded Files 

Download and install this plugin: 

 

"Microsoft Azure Storage for WordPress"  

 

Configure its settings by going to Settings > Microsoft Azure. 

 

Fill in the following information:  

 

Store Account Name:  

virteomcdn 

Store Account Key 

BnasGSAmhcQAzZf6qURkUJUWIV+iVpeM4hpPwp6ugh/XGkTA5+Tfr+gLLH19a6eL9E2n+iwXvhP6zPFnIzGZfw== 

Default Storage Container 

This will be blank, you can create a new Container by clicking the dropdown and selecting "Create New Container".  
Your container should follow this naming convention: 
wordpress-{sitename} 

Use Microsoft Azure Storage for Default Upload 

CHECKED 
(this will automatically upload new Media files to Blob. This can be unchecked to use local storage again.) 

Keep Local Files 

UNCHECKED 

Timeout for Azure file llist cahche in seconds 

15 

Cache control in seconds 

600 

 

Click Save.  

 

Example of completed Azure plugin settings 

 

Make This New Site Live 

After your testing is complete, update the DNS record from their old A record to the new one.  

Make note of all records (take a screenshot) before changing; we don't want to screw up their MX (mail) records. 

 

 

 

Troubleshooting 

  

WordPress tries to run an installation when I go to the site after changing the Hosts file. 

This is because the database prefix is incorrect in the wp_config.php file. Make sure you're using the right DB connection strings and $table_prefix in that file (see the "Database" section of this document).  

 

I changed the table_prefix and the connection string is right, but WP is saying it's already installed. What gives? 

Remove everything after the / in the URL - you're going to the install.php file which won't redirect you if the installation is complete.  

 

I hate WordPress. 

Me too. 

 

Azure Blob Storage isn't accessible when I upload an image OR I am getting a 404/403/40x message when going to an uploaded file.  

Public Access Level policy may need to be set on the newly-created Blob Container.  

Open Azure Storage Explorer on your computer. Navigate to  
virteomcdn > Blob Containers > {your-container-you-made}  
and right-click it.  
Click "Set Public Access Level". 

Click OK.  

Wait a few seconds, then re-try your link. You should not have to re-upload your image.