database-restore

drop whole database within a single command of restoring the dump of mongodb

寵の児 提交于 2019-12-01 23:05:03
I am trying to restore the directory dump of mongodb. i am doing mongorestore --db mydb --drop path/to/mydb/dump But both does not able to restore the state of my dump. Any new records are visible even after restoring the db. But no error is shown on console. I didn't see an answer and I had the same question today. You can drop the database before with: use <db> db.dropDatabase() Or you can only drop the collection with: db.<collection>.drop() The problem with your command could be that something misses, like the database which you authenticate against or the user or maybe another thing. In

Django loaddata - Out of Memory

走远了吗. 提交于 2019-12-01 05:43:51
I made a dump of my db using dumpdata and it created a 500mb json file now I am trying to use loaddata to restore the db, but seems like Django tries to load the entire file into memory before applying it and i get an out of memory error and the process is killed. Isn't there a way to bypass this problem? loaddata is generally use for fixtures, i.e. a small number of database objects to get your system started and for tests rather than for large chunks of data. If you're hitting memory limits then you're probably not using it for the right purpose. If you still have the original database, you

SQL Server “RESTORE FILELISTONLY” Resultset

耗尽温柔 提交于 2019-12-01 02:41:40
I'm trying to write an automated backup and restore T-SQL scripts. I've done BACKUP part but I'm struggling on RESTORE. When I run following statement on SS Management Studio; EXEC('RESTORE FILELISTONLY FROM DISK = ''C:\backup.bak''') I get a result set in a grid and also I can use INSERT INTO <temp_table> EXEC('RESTORE FILELISTONLY FROM DISK = ''C:\backup.bak''') to populate a temp table. However I get syntax error, when I try to select from that resultset. e.g SELECT * FROM EXEC('RESTORE FILELISTONLY FROM DISK = ''C:\backup.bak''') The resultset metadata should be stored somewhere in SQL

Restore MySQL database folder from a recovered Hard Disk

为君一笑 提交于 2019-11-30 10:43:50
问题 I was able to recover the database folder of MySQL server 5.5 of the corrupted operating system (Windows XP) at C:\Documents and Settings\All Users\Application Data\MySQL\MySQL Server 5.5\data\ How can I manually restore it to the new MySQL Server? When I open the folder, I found out several folders and I believed those are the databases. I didn't file any SQL Files. 回答1: Ok, I got the answer to my own problem. Possible Scenario MYSQL program is corrupted and fail to start. Fresh install of

Restore MySQL database folder from a recovered Hard Disk

有些话、适合烂在心里 提交于 2019-11-29 21:53:43
I was able to recover the database folder of MySQL server 5.5 of the corrupted operating system (Windows XP) at C:\Documents and Settings\All Users\Application Data\MySQL\MySQL Server 5.5\data\ How can I manually restore it to the new MySQL Server? When I open the folder, I found out several folders and I believed those are the databases. I didn't file any SQL Files. Ok, I got the answer to my own problem. Possible Scenario MYSQL program is corrupted and fail to start. Fresh install of MYSQL did not restore the data. Computer crashed but hard disk is still working Windows corrupted and fail to

PostgreSQL 9.1 pg_restore error regarding PLPGSQL

一世执手 提交于 2019-11-29 20:23:24
I am using Postgres for a django project and I am currently implementing a database backup/restore system that as simple as possible performs a pg_dump when the user clicks backup and then pg_restore when they click restore backup. All seems fine and dandy until it actually tries to perform the pg_restore at which time it gives this error: pg_restore: [archiver (db)] Error from TOC entry 3206; 0 0 COMMENT EXTENSION plpgsql pg_restore: [archiver (db)] could not execute query: ERROR: must be owner of extension plpgsql Command was: COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language'; I

Import .bak file to a database in SQL server

半城伤御伤魂 提交于 2019-11-29 18:55:28
I have a file with .bak extension. How can I import this date to a database in SQL Server? On SQL Server Management Studio Right click Databases on left pane (Object Explorer) Click Restore Database... Choose Device , click ... , and add your .bak file Click OK , then OK again Done. .bak files are database backups. You can restore the backup with the method below: How to: Restore a Database Backup (SQL Server Management Studio) You can simply restore these database backup files using native SQL Server methods, or you can use ApexSQL Restore tool to quickly virtually attach the files and access

Restoring SQLite DB file

左心房为你撑大大i 提交于 2019-11-29 00:34:34
I'm implementing a backup/restore system in my android app. An automatic backup occures every couple of minutes. I'm trying to restore my db backup file from my sd card, after my app was uninstalled and then installed again. Backup works, but here's the problem: Whenever the user installs my app again, there's a file not found exception, but, if the user closes the app, and then opens it again, the restore is just fine. Somehow, the restoring faces problem when the app is first launched. The restore must happen on first time launch. Note: the backupExists function returns true. @Override

SQL Server database restore error: specified cast is not valid. (SqlManagerUI)

本小妞迷上赌 提交于 2019-11-28 19:02:46
I am using SQL Server 2008 R2 Standard (version 10.50.1600.1) for my production website and SQL Server Express edition with Advanced Services (v10.50.1600.1) for my localhost as a database. Few days back my SQL Server crashed and I had to install a new 2008 R2 Express version on my localhost. It worked fine when I restored some older versions taken from Express edition but when I try to restore database from .bak file which is taken from production server it is causing the following error: Error: Specified cast is not valid. (SqlManagerUI) and when I try to restore the database using command

How to import a bak file into SQL Server Express

我是研究僧i 提交于 2019-11-28 16:27:08
问题 I have a .bak file, and I want to use this file to recreate the database in a fresh install of SQL Server 2008 Management Studio. Can someone point me in the right direction on how this can be done? I have tried: right click on the Databases container within object explorer from context menu select Restore database Specify To Database as either a new or existing database Specify Source for restore as from device Select Backup media as File Click the Add button and browse to the location of