Reinstall a VPS without losing data

2 min read07 November 2026

Reinstalling a VPS erases everything it holds: files, databases, accounts, SSH keys, firewall rules and scheduled tasks. It is irreversible and a forgotten backup cannot undo it. The operation makes sense when the system is compromised, broken beyond reasonable repair, or when you want a clean base. Preparation makes all the difference.

What disappears

Data Usual location Export
Website and code /var/www, /srv rsync or archive
Databases MariaDB, PostgreSQL mysqldump, pg_dump
Configuration /etc targeted copy
Scheduled tasks crontab -l text file
Accounts and keys /home, /root/.ssh encrypted backup
Certificates /etc/letsencrypt can be reissued

Backups included with the VPS plan depend on the plan. Check what the dashboard actually offers before relying on it; a provider backup never replaces a tested off-site copy.

Back up first

Copy files to another machine:

Bash
rsync -aHAX --numeric-ids /srv/ utilisateur@backup-machine:/srv/copy/

-a keeps permissions and dates, -H hard links, -A ACLs, -X extended attributes. Without --numeric-ids, UIDs may be translated and owners can change on restore.

Export databases:

Bash
mysqldump --single-transaction --routines --triggers --databases my_db > my_db.sql
pg_dump -Fc my_db > my_db.dump

Check the archive before destroying anything:

Bash
tar -tzf backup.tar.gz | head
grep -c 'CREATE TABLE' my_db.sql

Also record packages and services: dpkg --get-selections > packages.txt and systemctl list-unit-files --state=enabled > services.txt.

Reinstall from the dashboard

In https://dash.neoheberg.fr, open the VPS, choose reinstall and the proposed system is Debian 13. The operation destroys the container and recreates it. The root password is usually shown once: copy it before closing the window.

Wait for completion, then check the console and network address. Do not start the reinstall if the backup is not confirmed: there is no rollback.

Bring it back online

  1. Log in over SSH and update the system.
  2. Create the admin user and your keys.
  3. Reinstall the required packages and services.
  4. Restore files with rsync -a to preserve owners.
  5. Import the database, then restore the crontab.
  6. Re-enable the firewall and Fail2ban, then certificates.

Do not restore an old configuration without reviewing it: reinstalling is the moment to remove an unused service and rotate exposed secrets.

Verify

Bash
systemctl --failed
ss -tlnp
curl -I https://votre-domaine.fr

The site must answer, services must be enabled, and restored file permissions must match users that exist on the new system. Test an SSH login with your key before disabling password authentication.

Advertisement

Was this article helpful?

Read next