Back up only the settings

According to the link there is interest but several years have passed and I don’t know if they actually implemented it or not.

A very useful scenario for this is to configure a VPS server with the exact same settings as the production server, and this cloned VPS would be solely for development. This way, I can work more effectively with my team of developers.

4 Likes

Hmm… did you see the solution @pfaffman posted?

1 Like

It’s not a native solution, and the repository makes it clear that it might fail.

You can use Administrative Bulk Operations (link from the README):

3 Likes

You need much more than just the settings to see that stuff works. Why not just restore the production database to staging? See Set up a staging server.

3 Likes

One question: does that also clone the forum credentials and content? Because obviously the developers don’t need that, just the basic configuration to develop the plugins. I don’t want them to have access to my users’ accounts, much less the Administrator accounts.

Yes - it clones absolutely everything. If you’ve got untrusted devs, then it might not be the best thing. Personally, I’d get trusted devs!

As is, you would need to commit to cloning the structure in there that you need (e.g. settings, categories, groups, plugins, etc) and either maintaining it in sync manually, re-cloning it when needed, or developing your own solution to automate it.

Good luck!

1 Like

Then mabye export structure is close to what you need. It doesn’t export content

3 Likes

Can I choose what to export, right? What are all the available options? “etc.” doesn’t help much.

No.

There is no etc.

It exports

  • settings
  • admin users
  • groups
  • categories
  • tags/tag groups
  • themes/theme components/settings

Even if you trust your devs there can be regulations (like GDPR) that forbid you to share personal information with people outside a certain jurisdiction or that require you to minimize the amount of personal information that is copied to another system. Additionally, a development or staging server runs untested software which might contain security issues.

We always run something like this on the staging server immediately after restoring the backup from production, which anonymizes all users except staff and those in the testusers group.

keep_groups = Group.where(name: ['staff', 'testusers']).pluck(:id)
acting_user = User.find(-1)
User.all.each do |u|
  next if u.in_any_groups? keep_groups
  user = UserAnonymizer.new(u, acting_user).make_anonymous
end
5 Likes

That is very clever!

Should we roll that into the explainer about staging servers?

3 Likes