Détails

Back up your server before an update

What to copy before you update, with a Pterodactyl Panel and Wings as the example: the database, the .env file with its APP_KEY, the panel folder and the server data, and how to put them back.

Mis à jour le 21 octobre 2026 4 min de lecture

Les articles sont rédigés en anglais.

An update can fail halfway. With a backup made just before it, you can go back in minutes. This guide uses Pterodactyl as the example, but the same four parts (database, configuration with secrets, application files, data) apply to most web apps.

Store the backup on another machine, not only on the server itself: a backup on the same disk is gone when the disk or the server is.

What to back up#

Part Where (default) Why
Panel database the MySQL or MariaDB database panel users, servers, nodes, settings
.env file /var/www/pterodactyl/.env database password and the APP_KEY
Panel folder /var/www/pterodactyl the files of the version you run now
Wings configuration /etc/pterodactyl/config.yml the node's settings and its key
Server data /var/lib/pterodactyl/volumes on each node the files of every game server

Check your own paths: the data folder of Wings is the data setting under system in /etc/pterodactyl/config.yml.

Back up the panel#

Run these on the panel server. The commands below write to /root; use any folder only root can read.

  1. Put the panel in maintenance mode, so nothing changes during the backup:

    cd /var/www/pterodactyl
    sudo php artisan down
    
  2. Dump the database:

    sudo mysqldump --single-transaction --routines --triggers --result-file=/root/panel-backup.sql panel
    

    If your database is not called panel, look it up in .env without showing the rest of the file:

    sudo grep '^DB_DATABASE=' /var/www/pterodactyl/.env
    

    If the command asks for a password, add -u root -p (or the database user from .env).

  3. Copy the .env file:

    sudo cp /var/www/pterodactyl/.env /root/panel-backup.env
    
  4. Pack the panel folder:

    sudo tar -czf /root/panel-backup-files.tar.gz -C /var/www/pterodactyl .
    
  5. Protect the files, because they contain passwords:

    sudo chmod 600 /root/panel-backup.sql /root/panel-backup.env /root/panel-backup-files.tar.gz
    
  6. Copy them to another machine, for example with scp from your own computer:

    scp root@your-server:/root/panel-backup* .
    

    If you cannot log in as root, first copy the files to your own user's home folder on the server with sudo cp, give them to your user with sudo chown, and copy them from there. Delete that extra copy afterwards.

Leave the panel in maintenance mode if you go on with the update. Otherwise, run sudo php artisan up.

Back up the server data on a node#

The files of game servers change while the servers run. For a consistent copy, stop the servers first (in the panel, or tell your players), or make the copy at a quiet moment.

  1. Copy the Wings configuration:

    sudo cp /etc/pterodactyl/config.yml /root/wings-config.yml
    sudo chmod 600 /root/wings-config.yml
    
  2. Pack the server data. This keeps the owner and rights of every file:

    sudo tar -czf /root/wings-volumes.tar.gz -C /var/lib/pterodactyl volumes
    

    This can be large. Check the free space first with df -h and the size of the data with sudo du -sh /var/lib/pterodactyl/volumes. If there is not enough room, write the archive straight to another disk or machine.

The panel's own backups (on the Backups tab of each server) are stored by Wings in /var/lib/pterodactyl/backups by default, or in S3 storage if you set that up. They are useful, but they are not a copy of the whole node.

Put the panel back#

Do this if an update failed and you want to return to the state of the backup.

  1. Put the panel in maintenance mode: sudo php artisan down (if that fails, go on).

  2. Put back the panel files. Move the broken folder aside instead of deleting it:

    sudo mv /var/www/pterodactyl /var/www/pterodactyl-broken
    sudo mkdir /var/www/pterodactyl
    sudo tar -xzf /root/panel-backup-files.tar.gz -C /var/www/pterodactyl
    
  3. Put back the .env:

    sudo cp /root/panel-backup.env /var/www/pterodactyl/.env
    
  4. Put back the database. To get exactly the state of the backup, empty the database first, so tables that a failed update added are gone too. The database user keeps its rights:

    sudo mysql -e 'DROP DATABASE panel; CREATE DATABASE panel;'
    sudo sh -c 'mysql panel < /root/panel-backup.sql'
    
  5. Set the owner, clear the caches, restart the queue worker and leave maintenance mode:

    cd /var/www/pterodactyl
    sudo chown -R www-data:www-data /var/www/pterodactyl/*
    sudo php artisan view:clear
    sudo php artisan config:clear
    sudo php artisan queue:restart
    sudo php artisan up
    

Put the server data back on a node#

  1. Stop the game servers you restore, and stop Wings:

    sudo systemctl stop wings
    
  2. Unpack the archive in place:

    sudo tar -xzf /root/wings-volumes.tar.gz -C /var/lib/pterodactyl
    
  3. Start Wings again:

    sudo systemctl start wings
    

Files from the archive overwrite the current ones, but files that were added after the backup stay. To get back exactly the state of the backup for one server, move its folder aside first.

Test your backup#

A backup you have never restored is a guess. Once in a while, restore it on a test machine and check that the panel starts and shows your servers.

Next: update Pterodactyl Panel and Wings.

Une étape qui n’a pas fonctionné, un nom ou un chiffre erroné, quelque chose qui manque. Indiquez l’adresse e-mail de votre compte si vous souhaitez être récompensé par un crédit quand il est utile.

Merci. Nous lisons chaque signalement.

Toujours bloqué ?

Envoyez-nous un message via support.trivolut.com, ou ouvrez un ticket dans votre panneau.