Restore from backup does not restore the whole state of my forum

backup

(Anton) #1

Here is what I did:

  1. Make a backup through the admin panel
  2. Stopped the docker application and destroyed it
  3. Removed database related files/folders in shared/standalone
  4. Setup docker application again and launched it.
  5. Created a brand new admin user.
  6. Entered into the admin panel and imported my backup.

Some things did not restore, e.g:

  • menu items
  • css / js customization
  • default website locale

Is this intended or a failure of the restore?


(Régis Hanol) #2

What do you mean by menu items?

css/js customizations are stored in the database and are therefore part of the backup. They might need a restart of the application to work though (due to asset pipeline and caching issues).

default website locale is a site setting and is also stored in the database. We are aware that site setting aren’t properly reset after a restore and, like before, an application restart should fix it :wink:


(Anton) #3

Thanks.
is there anything that might NOT restore from a backup?
Also, is there a way to fully reset all possible cache?
Finally, can I rebuild search index on ALL posts/messages/everything?


(Régis Hanol) #4

Plugins.

That’s complicated :wink:

Yes, there’s the search:reindex rake task.


(Anton) #5

Okay, I see.
But will restarting the docker app clear all the cache?


(Régis Hanol) #6

Yes, that’s what I said earlier :arrow_double_up:


(Anton) #7

Thanks, it’s clear now.
So e.g. if I drop the database, then rebuild the app, then register a new administrator and go to admin panel and restore a backup - should I get 100% identical website (well, except plugins), including all possible settings etc? If yes, would you recommend doing anything more than re-indexing by rake search:reindex? Thanks.


(Régis Hanol) #8

Exact.

Not that I know of.


(Anton) #9

This is very helpful.

Just an idea: when I import a backup, does Discourse empty the /uploads folder before to put new images there? If not, then I should probably remove unused images somehow after the import?


(Régis Hanol) #10

No it doesn’t. But uploads with the same id/sha will be overwritten.

Easier if you do it before :wink:


(Kane York) #11

Yes, with the insertion I put in the quote.


(Dan Dascalescu) #12

This is quite a huge bummer. I’ve had the tagging plugin enabled, and indeed, all post tags were lost when I restored the backup onto a new instance. Not cool.

How can I bring over plugin data?

Anyway, a LOT of other settings are not restored:

  • site description
  • contact email & url
  • logo and favicon urls
  • ga tracking code, domain
  • all OAuth login settings
  • warn reviving old topic age
  • file extensions
  • etc.

… it actually appears that none of the site settings were restored. What am I missing? Posts were apparently restored correctly, including images.

I’m migrating from devmapper-based Docker instance to a separate host using AUFS, and want to bring over the entire forum, along with all its settings. I’ve made a backup, downloaded it, uploaded it to the new instance, and clicked Restore.


(Jeff Atwood) #13

Site settings are definitely restored, you may need to restart the instance to see changes due to caching – is this still correct @zogstrip?


Move your Discourse Instance to a Different Server
(Dan Dascalescu) #14

Ooh, much better! Site settings appear completely restored (including plugin errors), and the tags are back too. Does this mean @zogstrip’s post about plugin data not being restored is no longer accurate?

In any case, a message advising the user to restart the instance after restoring the backup would be great.


(Régis Hanol) #15

By plugin, I actually meant the list of plugins you’ve installed. The backups only contain a database dump and all the images/attachments. Plugins are defined at the container level. So, if the plugins store something in the database, it’ll be backed up but we won’t carry over that you installed that plugin. Does that make sense?


(Dan Dascalescu) #16

In other words, you’re responsible for restoring the section in app.yml that installs plugins:

## The docker manager plugin allows you to one-click upgrade Discourse
## http://discourse.example.com/admin/docker
hooks:
  after_code:
    - exec:
        cd: $home/plugins
        cmd:
          - mkdir -p plugins
          - git clone https://github.com/discourse/docker_manager.git
          - git clone https://github.com/discourse/discourse-tagging.git
          - ...

How to install Docker with AUFS on Linode
(Régis Hanol) #17

Yes, you are (for now at least).


(Simon Donaldson) #18

If you’re using DigitalOcean just SSH in an run
sudo shutdown -r now
that should fix all the backup missing data.

And to reindex run:

cd /var/discourse
./launcher enter app
rake search:reindex```