• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Resolved Testing website after migration

linuxKurt

Basic Pleskian
Server operating system version
Ubuntu 22.04.2 LTS
Plesk version and microupdate number
Plesk Obsidian Web Host Edition 18.0.51 Update #1
I successfully ran a migration from an older physical VM to a newer VPS using plesk migrator. After working thru all the issues, I am ready to test the website before the cutover.

Is there a simple way to put a temporary URL in front of the website so I can test it? Not 100% sure how to do this. I found the website preview settings under tools and have pointed the preview to my site. But not sure how to actually get it to render.

Technically I migrated a web server that was running a WordPress site and it had a vBulletin forum also.
 
Generally, testing can be done by modifying what is called the host file on your local system to point to the new IP address. This allows you to test it with the actual domain prior to updating the actual DNS affecting everybody.

The following explains it better;


If you're using a Linux desktop - the location would be /etc/hosts
I understand host files, seems like I could just navigate to the IP of the server in the URL if host file will work. Let me give it a try. It seems my webserver is pointing to a generic "starter" website. Need to figure that out.
 
Navigating via IP address isn't going to work since the vhosts is going to be looking for a host name response (aka yourdomain.tld), thus the best way to test is to update your HOSTS file updated to have your domain pointing to the new IP address as this will mimic what DNS would do once you've updated the DNS over.
 
Navigating via IP address isn't going to work since the vhosts is going to be looking for a host name response (aka yourdomain.tld), thus the best way to test is to update your HOSTS file updated to have your domain pointing to the new IP address as this will mimic what DNS would do once you've updated the DNS over.
thanks, i am getting same behavior. some config or site not working on new server

1681724220483.png
 
But not sure how to actually get it to render.
If it is a Wordpress website, you need to replace the "siteurl" and "home" datasets in the "*_options" table of that Wordpress installation with the preview url. That is because Wordpress knows its own URL, and if you open it through the preview url, but have not updated the options datasets to that url, Wordpress will try to connect to the real url. Then cross site scripting limits block some resources from load or the whole website is redirected to the real url. For that reason it does not work, and likely for a similar reason it does not display in the correct stylesheet. That is because it cannot load that stylesheet from the other url. But if you tell your website to run on the preview url you can easily see it in its full beauty.
 
If it is a Wordpress website, you need to replace the "siteurl" and "home" datasets in the "*_options" table of that Wordpress installation with the preview url. ...
Thanks, can this be done thru the Plesk Admin Console? I am going now to look for those tables.
 
You can edit database table content through phpMyAdmin. You can start phpMyAdmin from the "Database" menu of a subscription.
 
You can edit database table content through phpMyAdmin. You can start phpMyAdmin from the "Database" menu of a subscription.
Thanks, I am looking at the plesk console, I click on subscriptions and I see my subscription. When I open it, there are a bunch of tabs, but don't see phpMyAdmin, maybe I am in the wrong place.

1681756736203.png
 
Another option instead of changing the URL in the database would be to just temporarily add the preview URL to your wp-config.php file from the file manager which can be done in the following form;

define( 'WP_HOME', 'http://yourpreviewurl.com' );
define( 'WP_SITEURL', 'http://yourpreviewurl.com' );

Doing so will overwrite the settings in the WordPress admin panel. You can then simply remove the entries after testing and before going live.
 
Thanks, I am looking at the plesk console, I click on subscriptions and I see my subscription. When I open it, there are a bunch of tabs, but don't see phpMyAdmin, maybe I am in the wrong place.
The right place would be the "Databases" tab:

1681804213118.png
 
I am back trying to resolve this issue, I think the WordPress site can't connect to the database and I am not sure why. I checked the wp-config.php file to point to localhost:3306 and it still shows an error, I am unable to view the migrated site and it is annoying at best trying to figure it out. I did get phpmyadmin reinstalled, but it is throwing an error.

1682343757544.png
 
Another option instead of changing the URL in the database would be to just temporarily add the preview URL to your wp-config.php file from the file manager which can be done in the following form;

define( 'WP_HOME', 'http://yourpreviewurl.com' );
define( 'WP_SITEURL', 'http://yourpreviewurl.com' );

Doing so will overwrite the settings in the WordPress admin panel. You can then simply remove the entries after testing and before going live.
I did do these updates, but I am still having issues. When I go look at the WordPress site in Plesk Admin, this is what I see. As I checked wp-config.php and it is now pointing to the localhost:3306

1682376219057.png
 
Please remove the :3306, use "localhost" only. Also make sure that database name, database user name and database password all match exactly the database credentials.
 
Please remove the :3306, use "localhost" only. Also make sure that database name, database user name and database password all match exactly the database credentials.
i did remove 3306 from wp-config, the other info in wp-config is accurate, not 100% sure how to verify db_user below.

// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define('DB_NAME', 'wordpressDB');

/** MySQL database username */
define('DB_USER', 'db_admin');

/** MySQL database password */
define('DB_PASSWORD', 'xxxx');

/** MySQL hostname */
define('DB_HOST', 'localhost');

1682417043665.png
 
The user name that can access a database is displayed right next to the database on the "Databases" tab.
 
The user name that can access a database is displayed right next to the database on the "Databases" tab.
Thanks Peter, major progress. I can access phpMyAdmin, the wordpress section of Plesk show no errors. I recreated the temporary URL and now I am back to trying to access the site via temp URL. Whenever I access the URL it just shows the index page of the temp site. I am not sure how the temporay URL is supposed to work but I did point to the actual site when I created the temporary URL>

***** I updated wp-config file as recommended *****

/** remove after testing */
define( 'WP_HOME', 'http://optimistic-allen.162-222-999-99.plesk.page.162-222-999-99' );
define( 'WP_SITEURL', 'http://optimistic-allen.162-222-999-99.plesk.page.162-222-999-99' );


***** I also updated the siteURL directly using phpMyAdnub *****
***** I could NOT find a home option in the database *****

1682423568742.png
 
Your URL is invalid. A URL can bei *.plesk.page, but it cannot be something like plesk.page.*. I can also not recommend to use a *.plesk.page domain as a hostname, it is not meant for that purpose and you do not have DNS control over plesk.page domains. Why not use your hostname and use a suitable preview mode (configurable in Tools & Settings)? Or better: Why not save some time and use a real domain name or subdomain for tests?
 
Your URL is invalid. A URL can bei *.plesk.page, but it cannot be something like plesk.page.*. I can also not recommend to use a *.plesk.page domain as a hostname, it is not meant for that purpose and you do not have DNS control over plesk.page domains. Why not use your hostname and use a suitable preview mode (configurable in Tools & Settings)? Or better: Why not save some time and use a real domain name or subdomain for tests?
Thanks Peter, I went back to my real domain name and trying to use preview mode. Unfortunately, when I do preview it does not render the website. I also removed that temp domain. So I am sort of in a stock config.

1682433091091.png
 
The site is probably not rendered correctly, because not all references in the site have been updated properly to the new URL. You can try to use a plugin like Better Search Replace to replace one URL with another. Also, after changing the URL, you need to either update the siteurl and home definers in wp-config.php (if these are present) or change the siteurl and home datasets in the options table to the new URL. Definers in the wp-config.php file take precedence over the option table.
 
Back
Top