Vacuum sqlite when your storage is full (Docker)

Just wanted to save you guys days of research. It took me 2 days to figure this out.

I started looking att similar issues like this

So this is how I solved it:

  1. Add this to your .env file:
#Delete logs
  1. Install sqlite3 (if you don’t know how google it :wink:
  2. #docker-compose down
  3. #docker-compose up (this will start the prune)
  4. Go to your sever provider and add volume (the size needs to be att least as big as your current storage)
  5. #docker-compose down
  6. cd in to the database.sqlite file
    we are going to create a mounted folder and move the file. In my case the /dev/sda is the correct mount but you can find yours by “df -h”
    Important to mv to a full path otherwise your file will end up in root. so run pwd to find the full path to the folder you are moving the file.
mkdir /vacuumtemp
mount /dev/sda /vacuumtemp
mv database.sqlite /FULLPATH/vacuumtemp
  1. #cd vacuumtemp
  2. #sqlite3 database.sqlite
  3. sqlite> vacuum;
  4. sqlite> .exit
  5. #mv database.sqlite Fullpath/.n8n
  6. cd to your docker-compose.yml file
  7. #docker-compose up