Errors in moving ghost site to new server

Hello,

I’m working on moving my site from my old Ubuntu LTS server to a new one so that I can run Mysql 8, Ghost 5 and be stable for more years to come. This process was easy on my non member websites but it has proven to be a huge pain on member sites.

To whit - the memberships get all messed up which is no good. When I export my member list and reimport it in the new server I have the same number of members but I’m missing 3 paid members. I think the issue is that these members had at one time ended their subscription and then started them again.

On top of this all my analytics data is gone now which seems to be a huge loss to me.

Is there a way to get all my member data and analytics out of ghost and move it to another server?

I’m now starting to try to dump the whole mysql database and upload that. I’m not sure if this is a good idea or not. Does anyone have any experience with this? My first try partially worked but not totally as I’m dumping a 4.41.3 ghost site then trying to upload to a ghost 5.x site. Somethings work. Other parts do not.

I think there needs to be some better documentation about this as this is a pretty important use case. Especially as I tried to upgrade my ubuntu server but this failed horribly so I did a fresh install of a new image in the hopes i could just move my data that way.

Thank You,
Kyle

I recommend copying your database and Ghost files over verbatim to the new server. You can use a MySQL export/import process for the database.

Then on the new server, use the Ghost CLI to use the official upgrade procedure.

It sounds like you may have used the Ghost export/import tools which may not capture all the data.

Thank you for that link.

I’m working through this as the night goes on so will keep replying with more thoughts.

The trouble is that I can’t update to ghost 5 on my ubuntu server without a bunch of work to get mysql 8 installed. So when I do a manual reinstall on the new server with the mysqldump from the old server there is some corruption of the database and it doesn’t work (which is to be expected as the upgrade from 4.x to 5.x probably changes the database some.

It’s very shocking to me that there is no good way to export all the ghost user data. It seems like a major problem that when I export my member list and reimport it I loose paying members. I could deal with loosing the analytics but loosing track of paying members is a big problem.

I’m continuing my experimentation.
Thank You,
Kyle

Does this help?

I had a few problems, sorted it using these steps.

If you could share more about your current and target environments, we may be able to offer more targeted assistance.

1 Like

Could the difference you are seeing in your subscriber count have to do with unsubscribe-vs-deleted? Inconsistency between subscribers and send amount - #2 by David_Ramos

Thank you for the reply.

What you layout here is basically what I’m trying to do with a couple of tweeks like reinstalling ghost on the new server. I’m going to start fresh this morning and do all the steps again to see if it works.

My systems are:

Current system:
Debug Information:
OS: Ubuntu, v18.04.6 LTS
Node Version: v16.15.1
Ghost Version: 4.48.2
Ghost-CLI Version: 1.19.2
Environment: production
Command: ‘ghost doctor’
mysql Ver 14.14 Distrib 5.7.38, for Linux (x86_64) using EditLine wrapper

System I’m Migrating To:
OS: Ubuntu, v20.04.4 LTS
Node Version: v16.14.2
Ghost Version: 4.48.2
Ghost-CLI Version: 1.21.0
Environment: production
Command: ‘ghost doctor’
mysql Ver 8.0.29-0ubuntu0.20.04.3 for Linux on x86_64 ((Ubuntu))

Thank You,

This is not the issue I’m experiencing. My difference is in paid members specifically. I’m missing paid members after the migration but have the same count of total subscribers, etc.

I think the issue is that the paid members I’m missing all have at one point ended a subscription and then started their subscriptions again. One my instance it shows two different subscription events - the first one canceled and the second one started again. When i migrate over only the first one seems to come through missing the fact that they resubscribed.

This could be really, really bad as their subscription is still registered in stripe but they would be unable to have any benefits.

I think I’d be inclined to clone the original server, do a dist-upgrade, and then update MySQL, Ghost etc.

Once everything is hunky dory, I’d do it all again (essentially scripted), but put the original server under maintenance to prevent user changes, before updating DNS.

I finally got it to work. I’ll write up the process and make a new post for anyone that has this similar problem but I need to get on with the weekend with the family.

Basic process is this:

  1. Export Mysql database with mysqldump
  2. Copy content/images from old host
  3. Export your theme from old install
  4. Create New Server, eg, ubuntu on a vps
  5. Install ghost with the SAME version of your previous server, eg: ghost install 4.48.2
  6. Drop newly created database from mysql
  7. then create empty database in Mysql
    use your mysqldump file from step 1
  8. import old mysql database
  9. copy over the content/images directory to new install
  10. add mailgun mail settings to config.production.json
  11. restart the ghost instance
  12. upload theme and activate
  13. use ghost update to install and migrate to newest version of ghost

I think those are all the steps. I write this up again better later today after I’ve spent time with the family just wanted to get these notes down for myself and others while its still in my head!

I’ll probably also file a big report about the member export list as this seems to be a possible bug.

Thank you all for all the kind and generous help.
Kyle

2 Likes