I'm trying to migrate my site between servers using the following guide:
https://docs.wordops.net/guides/wordpress-migration/
I was able to follow all the steps, but visiting the new site at the end shows a database access error
Connection error. Visit the admin area for more details or open the config.php file and check the database information. Message: Access denied for user 'oldDBusername'@'localhost'.
There has been a critical error on this website.
Learn more about troubleshooting WordPress.
In this case, oldDBusername is from the imported database (and can be found on the old wp-config.php).
Perhaps this is an issue between MariaDB / MySQL / WP-Cli compatibility in the guide?
Here are my steps and some troubleshooting:
I ran into an issue at the following step:
sudo -u www-data -H wp db clean --yes --path=/var/www/mydomain.tld/htdocs
rm -rf /var/www/mydomain.tld/htdocs/*
I get the following error:
Error: Failed to get current SQL modes. Reason: /usr/bin/env: 'mysql': No such file or directory
It appears it may be an issue with a recent WordOps update as someone posted about the issue as well here:
After creating the suggested symlinks, I was able to proceed with the migration guide step
mysql: Deprecated program name. It will be removed in a future release, use '/usr/bin/mariadb' instead
Success: Tables dropped.
I was also able to import the database dump as the penultimate step of the guide
cd /var/www/mydomain.tld/htdocs
wp db import mydomain_com_erFwge-2024-10-11-0eg34.sql --allow-root
rm mydomain_com_erFwge-2024-10-11-0eg34.sql
Output:
mysql: Deprecated program name. It will be removed in a future release, use '/usr/bin/mariadb' instead
Success: Imported from 'mydomain_com_erFwge-2024-10-11-0eg34.sql'.
When I look through MariaDB / MySQL database and users on the new server, I only see the database and user detailed in the current (freshly created) wp-config file and nothing from the imported dump.
Sadly, I'm at a loss and don't know how to resolve this. Any pointers?