Hello! I’ve recently been testing out PieFed (I followed the Docker install instructions), it’s actually working quite well… However, I’m a bit of a newbie system administrator, I was wondering if there was a guide or documentation available on how to back up/restore a PieFed instance installed this way? Being able to back up and restore the instance is the one stumbling block I need to get past in order to self host PieFed, so I would certainly appreciate any help that people can provide 😀 Thanks!

  • wjs018@piefed.wjs018.xyz
    link
    fedilink
    English
    arrow-up
    2
    ·
    2 days ago

    I am not much of a sysadmin either and have had to get help from some other instance admins in the past. Here is the exact process I go through to manually make and then restore a backup. I don’t have this automated since I just work in dev environments, but you could put this in a shell script and schedule it with cron or something like that.

    Here is how I make the backup (pgdata folder in my case):

    # Prerequisite: navigate to the pyfedi folder
    
    # Shut down the docker containers
    docker compose down
    
    # Wait for the containers to shut down...
    
    # Then make the backup of the db volume
    sudo rsync -a pgdata/ pgdata_backup
    

    And here is how I restore the backup if I mess up my db:

    # Again, need to be in the pyfedi folder
    
    # Shut down the docker containers
    docker compose down
    
    # Wait for the containers to shut down...
    
    # Delete the messed up db folder
    sudo rm -r pgdata
    
    # Rename the backup folder to swap it back in
    sudo mv pgdata_backup pgdata
    
    # Start the containers back up
    docker compose up -d
    
    • Phoenix1@piefed.socialOP
      link
      fedilink
      English
      arrow-up
      1
      ·
      2 days ago

      I’d like to thank you very much for this, it’s easy to follow and it explains each of the steps well! I will go about turning this into a script for cron!