2

I am attempting to migrate an existing Wordpress CiviCRM installation to a new server, but am having some difficulty with the database part.

The existing installation is Wordpress 3.8.1 and CiviCRM is 4.4.3. The installation on the target server is Wordpress 4.9.1 and CiviCRM 4.7.27.

I used mysqldump to copy the existing database and then transferred to the new server. I used the mysql root login to execute these commands on both servers.

Once I got the database copied to the target installation, it appeared that no database was there when I ran a report in CiviCRM. So I went back to the original wp-config file and noticed there was a different username and password for the original database (not the root one I used to transfer). I then changed the target server's wp-config file to reflect the other password (shown on the old server), but began getting WP login errors, saying the password was incorrect.

I retrieved the old installation's WP password and was able to login (after changing the wp-config file back to root DB credentials. I had to do that before I could bypass a screen that said 'database connection failure'. But anytime I change the new wp-config file to use the same DB username and password as on the old wp-config file, it throws the database connection error.

I figured since it allowed me to transfer the database using the root password, then I could use that in the wp-config file, but I'm not sure if that's right.

Any ideas what might be going on? I feel like I've missed a step or done something incorrectly. Hopefully my situation makes sense. Many thanks to anyone who could point me in the right direction.

3

There is some documentation here that should help: https://docs.civicrm.org/sysadmin/en/latest/misc/switch-servers/

Are you copying the Wordpress database as well?

You are trying to switch servers and upgrade at the same time. I would strongly suggest you do that in multiple stages: first move to the new server using the same versions of Wordpress and CiviCRM - make sure that is working correctly, and then upgrade.

Switching to a new server involves changes with URL's, directories, passwords etc so get that set of issues resolved first. That is often more tricky than upgrading.

You are also going from 4.4 to 4.7 which is a big leap. Opinions vary as to the best way of doing that: a single upgrade should work, but you may be better to upgrade to the last 4.5, take a backup, upgrade to the latest 4.6, take a backup then go to 4.7. It is extra steps but may save you time in the end if things go wrong.

To your issues with passwords: to dump the databases from the old server, you need the password for the old server. When you load it to the new server, you need the new password. civicrm.settings.php needs to have the new passwords but the changes you need to make depend on which option you follow in the guide for copying the codebase (Step 4).

If that looks too daunting there are plenty of people at https://civicrm.org/partners-contributors who would help. (Yes, I'm one of them!)

  • Thanks for your reply Aidan! I didn't realize there was also a Wordpress database. Is that typically migrated too? Which database is the wp-config supposed to point to? The WP DB or the CiviCRM DB? Also thanks for letting me know about the partners. I may need to call on you if I can't get unstuck. – gilesitis Dec 8 '17 at 16:05
  • Update: I started over all installed the older versions of WP and Civi to match what's on the old server. It looks like the WP database is working correctly because it is showing the organization's name and email. I then installed the Civi plugin and during the checks it showed it could log in and access the database. However, all the reports I run come back and say 'no results found' , so it looks like something is still amiss with the civi DB. Any suggestions on what to check next? – gilesitis Dec 8 '17 at 20:04
  • Update 2: I ran some queries on the database that was copied onto the new server. I can see the tables in the database, but doing a SELECT * FROM CiviCRM_contribution returns an empty set. The same query ran on the old server DB returns results. – gilesitis Dec 8 '17 at 23:26
  • Update 3: Problem appears to be solved. Using some GoogleFu, I found there are two separate commands for backup/restore of a DB. I had used mysqldump for both. I recopied the DB using mysql (instead of mysqldump) to restore it. The query returned results and I'm seeing data in my CiviCRM reports. Thanks for your guidance! – gilesitis Dec 9 '17 at 0:27
  • Well done @gilesitis - looks like you have persevered and been successful! – Aidan Dec 12 '17 at 8:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.