Errors in moving ghost site to new server


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,

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,

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.


Same thing just happened with my member import. In order to upgrade to MySQL 8 on DigitalOcean, I had to create a new droplet and migrate everything over. On importing my members CSV, it lost six of my paid member’s subscriptions.

I noticed one related issue/cause: in Ghost’s import dialogue, the “products” field had no corresponding “Import As” option and had to be left as “Not imported.”

Has this been reported as a bug yet? It seems like a pretty serious one, if many others will be going through migration for the MySQL upgrade.

EDIT: I also just discovered it did not import members’ newsletter subscriptions properly, likely because I have multiple newsletters. Looks I’m going to have to switch everything back to the old install until this can be fixed.

Use snapshots, fire up a new droplet, upgrade to MySQL, and when things are working switch DNS to new IP. And, do a dry run first.

Would a snapshot from a MySQL 5 droplet work with one running 8?

Or did you mean back up the original with a snapshot, make a new droplet with it, and then upgrade that one? I did start by trying to upgrade MySQL on my original droplet, but DO strongly recommended against it.

Yes, essentially create a clone, and get this working with MySQL 8.

Your production site is unaffected, so take your time.

1 Like

Since everything else migrated without problems, and since this isn’t urgent (yet), it seems like the simplest option would be to wait for an update to the member import tool that supports multiple newsletters and tiers.

Hopefully that will come before MySQL 8 is required!

MySQL8 is necessary now, and the sooner you make the upgrade, the better. Delaying is likely to cause something to break.

As mentioned, take advantage of DO snapshots, and clone your working system. An additional droplet will cost next to nothing for the time it is needed.

Thanks for your time working through this. Maybe I’m misunderstanding, but the notice I’m seeing is that 8 will be required for “the next major release.” That would be Ghost 6.0, right?

As for the additional droplet, I already have it, and it’s fully set up aside from the member import. That’s why it seems simplest to wait for a fix.

Either way, I don’t want to lose the point here, which is that the member import tool doesn’t yet support all the fields in an export. This will be important for anyone trying to use the tool, not just for my use case.

Ahh, you’re right, and I now see that in the docs as well. I didn’t see that message until well after I had updated to 5.0, so I assumed it meant the next one.

Sooner it is. Thanks for the heads up!

1 Like

Just to following up here, in case anyone else is considering this method for upgrading: I had a terrible experience upgrading Ubuntu on DigitalOcean that took weeks to resolve, but I’ve finally got it working.

It should be noted that DigitalOcean’s support chastised me over and over for doing the upgrade in place and insisted that migration was the only reliable way. Hopefully the Ghost team will be updating the import tool to support all member fields soon. If I hadn’t gotten in so deep, I would rather have just risked the wait.