Question

I destroyed my nginx config after upgrading :(

This isn’t really a question, I guess, as I think I can recover things, but perhaps it’s a cautionary tale, and maybe someone has some insight to offer.

I recently upgraded a droplet from Ubuntu 20.04 to 22.04. One of the last steps of do-release-upgrade is to remove outdated packages, but it warns that could take hours, so I deferred that until after the machine was back up and running. Everything seemed fine, so I went about removing old packages. Based on advice found online, I also removed config files for everything marked RC in dpkg -l. That was a mistake, as one of the packages was nginx, and that wiped out my /etc/nginx directory, as well as /var/log/nginx, and perhaps others.

It was extremely puzzling, because the server was still running just fine. I realized it only reads the config when it starts up and doesn’t need it again.

Now, there’s still an nginx installed, as shown by dpkg -l, so I don’t know why the dpkg --purge removed the config files. I consider this a bug.

Fortunately, I did a snapshot just before the upgrade, and I’m instantiating a new droplet from it, hoping to copy over the nginx config.

It’s too bad one can’t mount a snapshot as a filesystem on an existing droplet. I think that would be a very useful feature.


Submit an answer


This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

KFSys
Site Moderator
Site Moderator badge
March 6, 2024

Hey @jetforme,

Great idea, sounds like it’d be super useful!

The best thing to do to get your voice heard regarding this would be to head over to our Product Ideas board and post a new idea, including as much information as possible for what you’d like to see implemented.

https://ideas.digitalocean.com/

Hope that helps! - KFSys.

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Become a contributor for community

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

DigitalOcean Documentation

Full documentation for every DigitalOcean product.

Resources for startups and SMBs

The Wave has everything you need to know about building a business, from raising funding to marketing your product.

Get our newsletter

Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.

New accounts only. By submitting your email you agree to our Privacy Policy

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.