Transfer host to new server

Technical Support
  • #1

    I was wondering if there is any working way to transfer an existing NodeBB site to a new host, without losing any data. I've seen some posts on here regarding the same thing but they are considerably dated so I didn't know if there if there is any good way to do it for a recent installation.

    Thank you.

  • Community Rep

    @Kolt-L I would do something along the following:

    1. Get everything ready/tested on the new host.
    2. Backup database, e.g. mongodump, and user uploads dirs on the old site.
    3. Dump/drop db on the new host and restore w/actual data from #2 above.
    4. Repopulate nodebb uploads dirs on the new host from #2 above.
    5. Update DNS Zone record - see below.
    6. Pull plug on old
    7. Plug in the new.

    How fast the change propagates thru the net involve some DNS admin planning:

    Presuming you have access to the DNS for the domain:

    1. Shorten the zone's TTL to something like 1h a day or two ahead of time, depending on existing TTL.
    2. Update the zone record - transition to new site.
    3. Monitor real close like and if goes awry role back real quick like. So have your DNS accessible.
    4. All goes well, update TTL on your zone's record to something more reasonable, e.g. 24-48hr.

    Edit: Oh yeah, in case not obvious, you're going to want to put the old site in "Maintenance Mode" while your transitioning, lest you risk loosing some posts.

  • #3

    How do I use mongodump as I am getting the error, Failed: error creating intents to dump: error getting database names: (Unauthorized) command listDatabases requires authentication

  • Community Rep

    @Kolt-L It depends on your set up details, of which I know not. But maybe resembles something like:

    mongodump -u <your mongo user here> -p <your mongo user pass here> --out /where/you/want/the/backup/files/$(date +%F)  --authenticationDatabase=admin

    If, perchance ye' followed the nodebb docs for setting up mongodb here and here then you should have an admin user. Hopefully you still have that pass tucked away safe somewhere.

    /where/you/want/the/backup/files/$(date +%F) should now be populated with sub directories for each of the admin and nodebb databases. Ensure you copy them both to the new server.

    For future reference, I prefer not to have my privileged admin user running cron scripts so I created a "backup operator" user with limited privileges for such duties. YMMV.

    Note: You may need to quote the pass phrase if it contains special characters.

Suggested Topics

| | | |