backup

Django backup strategy with dumpdata and migrations

烂漫一生 提交于 2019-11-30 21:25:29
As in this question , I set up a dumpdata -based backup system for my database. The setup is akin to running a cron script that calls dumpdata and moves the backup to a remote server, with the aim of simply using loaddata to recover the database. However, I'm not sure this plays well with migrations . loaddata now has an ignorenonexistent switch to deal with deleted models/fields, but it is not able to resolve cases where columns were added with one-off defaults or apply RunPython code. The way I see it, there are two sub-problems to address: Tag each dumpdata output file with the current

Export mysql table into SQL format? [closed]

喜欢而已 提交于 2019-11-30 21:21:55
Is it possible to export a table with its records into SQL format via PHP code ? I've been looking around and all I found is exporting it as CSV file. However I found the code below : backup_tables('localhost','root','','compare_db'); function backup_tables($host,$user,$pass,$name,$tables = '*') { $link = mysql_connect($host,$user,$pass); mysql_select_db($name,$link); //get all of the tables if($tables == '*') { $tables = array(); $result = mysql_query('SHOW TABLES'); while($row = mysql_fetch_row($result)) { $tables[] = $row[0]; } } else { $tables = is_array($tables) ? $tables : explode(',',

How to backup SQL Server Agent jobs?

你。 提交于 2019-11-30 19:03:01
How can I backup and restore SQL Server 2005 Agent job schedules? the msdb database is where all the jobs live, it is one of the system databases You can also script all the jobs out as a sql file and store them in svn or other source control if you'd like to track changes. 来源: https://stackoverflow.com/questions/1094040/how-to-backup-sql-server-agent-jobs

PHP download backup of MySQL database

ぐ巨炮叔叔 提交于 2019-11-30 16:16:29
I want to give a client the ability to manually download a backup of his database. I am coding the site using PHP and MySQL. So after the admin user has logged in there would be a link in the menu to download a .sql file to the local computer. How can I accomplish this with PHP? This can get messy trying to back up a database from PHP, you would be better of letting MySql handle this, and the best way to tell mysql to do this is with a shell script: #!/bin/bash # Shell script to backup MySql database # To backup Nysql databases file to /backup dir and later pick up by your # script. You can

Backup MySql database with PHP

孤街浪徒 提交于 2019-11-30 15:55:08
问题 I have a pretty large db in MySql, and I need to take backups of it every day or so. I need to be able to take backups from any computer, so therefore I thought about making a php script to do this and put this php script online (offcourse with password protection and authorization etc so that only I can access it). I wonder however, how is this done properly? What commands should I use, and is it possible to change settings of the backup (for instance Add AUTO_INCREMENT value = true )? I

Backup MySql database with PHP

让人想犯罪 __ 提交于 2019-11-30 15:41:45
I have a pretty large db in MySql, and I need to take backups of it every day or so. I need to be able to take backups from any computer, so therefore I thought about making a php script to do this and put this php script online (offcourse with password protection and authorization etc so that only I can access it). I wonder however, how is this done properly? What commands should I use, and is it possible to change settings of the backup (for instance Add AUTO_INCREMENT value = true )? I would appreciate examples... Also, if this is a bad method (unsafe, or maybe gives bad backups with bad

Backup SQL Server via C#

好久不见. 提交于 2019-11-30 15:18:09
How easy is it to backup a SQL Server database via C# code? I see lots of related questions, but no real answers. Or: Generate your backup script in Management Studio, put it in a stored procedure, run procedure from C# code. CREATE PROCEDURE sp_backup AS BEGIN BACKUP DATABASE [YourDatabase] TO DISK = N'C:\YourPathAndFile.bak' WITH NOFORMAT, NOINIT, NAME = N'Full Database Backup', SKIP, NOREWIND, NOUNLOAD, STATS = 10 END GO SQL Management Objects - Microsoft.SqlServer.Management.Smo It has the methods you need to complete that action. See using SMO Library from c# on how to use SMO library

How to backup/restore SQLite database on Android to Dropbox

▼魔方 西西 提交于 2019-11-30 15:16:08
I am currently developing an Android application which makes use of the SQLite database. I am looking for ideas how to backup/restore the database to and from external services such as Dropbox. I have gone through some explanations such as below: Android backup/restore: how to backup an internal database? Backup/restore sqlite db in android These explanation are mainly about backing up locally, but I want to backup to cloud, as I mentioned, something like Dropbox. Help please... Thanks in advance... Nachi Using the answer here , you can get a reference to your database in the form of a .db

Build Tar file from directory in PHP without exec/passthru

纵然是瞬间 提交于 2019-11-30 15:06:08
问题 So I have a client who's current host does not allow me to use tar via exec()/passthru()/ect and I need to backup the site periodicly and programmaticly so is there a solution? This is a linux server. 回答1: PHP 5.3 offers a much easier way to solve this issue. Look here: http://www.php.net/manual/en/phardata.buildfromdirectory.php <?php $phar = new PharData('project.tar'); // add all files in the project $phar->buildFromDirectory(dirname(__FILE__) . '/project'); ?> 回答2: At http://pear.php.net

Are concurrent git pushes always safe if the second push only has fast-forwards from the first push?

核能气质少年 提交于 2019-11-30 12:49:05
I want to automatically push commits in the post-receive hook from a central repo on our LAN to another central repo in the cloud. The LAN repo is created using git clone --mirror git@cloud:/path/to/repo or equivalent commands. Because the files being committed will be large relative to our upstream bandwidth, it's entirely possible something like this could happen: Alice initiates a push to the LAN repo. Bill pulls from the LAN repo while the post-receive hook is running. The LAN repo is in the middle of pushing to the cloud repo. This also means Bill's local repo contains the commits Alice