Synchronizing Staging Server

Hi Folks,

I've recently discovered the wonders of QEMU as a way to run an emulated server on my laptop. One of the best uses I can think of for this is to run an exact copy of my production Linode server that I can use for staging changes - new software installs and configurations mostly. I'm using Debian Sarge.

Can anyone help me out with a way to synchronize the package lists between my linode and another server (my staging server) so that I can be sure anything I'm testing in one will work in the other?

I've been thinking about using rsync, but I know there are some directories I'd want to avoid (/proc, /dev, etc. - anyone know of a comprehensive list so that I could safely use rsync to synchronize the servers?).

Thanks, Tom

2 Replies

I'm assuming you want to get your staging system installed with the packages and options you want for your production server, then magically cause the production server to adopt the new packages and options.

I'm thinking rsync isn't the way to go to for this. The interdependencies are such that copying files basically in random order, as rsync would do, could be very bad for running programs that access those files. You could set something up to stop running programs that depend on changed files, etc, but you would basically end up making your own package manager.

You might consider messing around with I think /var/cache/debconf/config.dat. I believe it's posisble to preload package installation options there. You might be able to copy that from your staging server version to at least get the package installation options over. Might be better ways to do that, but I think that works. If you ever change package options on the production server independent of the staging server, you'd have to reconcile the differences.

After you get the default installation options transferred, it might be simplest just to install all staging server packages to the production server. If a package is already loaded, it won't hurt to have it try to install it again, it will just say it can't be upgraded or something.

You might be able to use the rsync method if you shut down your production linode, mount its file system under another running configuration, rsync that, then restart it. But I assume you want to avoid shutting down your production server and then waiting for an rsync to complete.

Good luck.

Thanks for the thoughts.

I think you may be right - I was kind of hoping I could just rsync everything except for /dev /proc and a few others, and voila, I'd have a mirror of my production server that I could play around with. But you're right, there are probably other issues to think of.

At the moment, what I've done is used dpkg –get-selections to get all the installed packages, and then loaded those into my staging server. And I'm using rsync wrapped in a script to synchronize some other files.

I think it will be a work in progress, but I'll keep working on it. And yes, I would prefer to avoid bringing the server down!

Thanks, Tom

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct