How to take backup of a single table in a MySQL database?

Dump and restore a single table from .sql Dump mysqldump db_name table_name > table_name.sql Dumping from a remote database mysqldump -u <db_username> -h <db_host> -p db_name table_name > table_name.sql For further reference: http://www.abbeyworkshop.com/howto/lamp/MySQL_Export_Backup/index.html Restore mysql -u <user_name> -p db_name mysql> source <full_path>/table_name.sql or in one line mysql -u username -p db_name < /path/to/table_name.sql Dump and … Read more

Backup and restore SQLite database to sdcard

Here is my code: // Local database InputStream input = new FileInputStream(from); // create directory for backup File dir = new File(DB_BACKUP_PATH); dir.mkdir(); // Path to the external backup OutputStream output = new FileOutputStream(to); // transfer bytes from the Input File to the Output File byte[] buffer = new byte[1024]; int length; while ((length = … Read more

How do I backup a database file to the SD card on Android?

This code works for me! try { File sd = Environment.getExternalStorageDirectory(); File data = Environment.getDataDirectory(); if (sd.canWrite()) { String currentDBPath = “//data//{package name}//databases//{database name}”; String backupDBPath = “{database name}”; File currentDB = new File(data, currentDBPath); File backupDB = new File(sd, backupDBPath); if (currentDB.exists()) { FileChannel src = new FileInputStream(currentDB).getChannel(); FileChannel dst = new FileOutputStream(backupDB).getChannel(); dst.transferFrom(src, … Read more

Fully backup a git repo?

git bundle I like that method, as it results in only one file, easier to copy around. See ProGit: little bundle of joy. See also “How can I email someone a git repository?”, where the command git bundle create /tmp/foo-all –all is detailed: git bundle will only package references that are shown by git show-ref: … Read more

Backup a GitHub repository

I am not sure it could cover all your requirements, but you could check out git bundle git bundle This command provides support for git fetch and git pull to operate by packaging objects and references in an archive at the originating machine, then importing those into another repository using git fetch and git pull … Read more