Hi there,

How would I go about dumping an sqlite database on Ubuntu 16.04?

I am using an sqlite database within TeamSpeak 3 but do not know the commands to dump the sqlite database.

Any help would be appreciated.

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.

×
1 answer

@alexeps2014

The easiest way would be to use .dump, for example:

sqlite3 dbname.db .dump > dbname.bak

You can either cd in to the directory where the database is, or call the direct path during execution.

For example, if your database is located at:

/home/sqlite/teamspeak3.db

and you wanted to backup the database to

/usr/local/src/teamspeak3.bak

you’d use:

sqlite3 /home/sqlite/teamspeak3.db .dump > /usr/local/src/teamspeak3.bak
  • Hi there,

    Thanks for responding.

    I attempted your method, however it unfortunately failed.

    I typed:

    sqlite3 /home/teamspeak/ts3server.sqlitedb .dump > /usr/local/src/teamspeak3.bak
    

    However, the droplet responded:

    "The program 'sqlite3' is currently not installed. You can install it by typing: apt install sqlite3"
    

    I cannot execute this command as networking is currently disabled on my droplet as I have recently become victim to a DDoS attack, thus the reason of me wanting to dump/backup the sqlite database in the first place.

    What would be the next step?

    • @alexeps2014

      If you’re running an older version, it may just be sqlite instead of sqlite3.

      If neither work, then you’ll need to install sqlite3 by running:

      apt-get -y install sqlite3
      

      Once installed, you’ll be able to run the command I provided in my previous response.

Submit an Answer