database-restore is an operation intended to restore data from importing serializing database tables from a text format or from a binary format
Questions tagged [database-restore]
703 questions
287
votes
9 answers
Import .bak file to a database in SQL server
I have a file with .bak extension.
How can I import this file data to a database in SQL Server?
Tibin
149
votes
3 answers
Postgresql - backup database and restore on different owner?
I did backup on database on different server and that has different role than I need, with this command:
pg_dump -Fc db_name -f db_name.dump
Then I copied backup to another server where I need to restore the database, but there is no such owner…

Andrius
- 19,658
- 37
- 143
- 243
145
votes
19 answers
Enable binary mode while restoring a Database from an SQL dump
I am extremely new to MySQL and am running it on Windows. I am trying to restore a Database from a dumpfile in MySQL, but I get the following error:
$ >mysql -u root -p -h localhost -D database -o < dump.sql
ERROR: ASCII '\0' appeared in the…

user1434997
- 1,689
- 2
- 12
- 12
94
votes
4 answers
SQL Server database restore error: specified cast is not valid. (SqlManagerUI)
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…

Learning
- 19,469
- 39
- 180
- 373
88
votes
6 answers
Android backup/restore: how to backup an internal database?
I have implemented a BackupAgentHelper using the provided FileBackupHelper to backup and restore the native database I have. This is the database you typically use along with ContentProviders and which resides in…

pjv
- 10,658
- 6
- 43
- 60
82
votes
7 answers
PostgreSQL 9.1 pg_restore error regarding PLPGSQL
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…

fury-s12
- 1,240
- 3
- 12
- 18
72
votes
5 answers
How to import a bak file into SQL Server Express
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…

Ashok
- 1,868
- 6
- 36
- 70
67
votes
7 answers
Why is "close existing connections to destination database" grayed out on SQL Server 2012 Management Studio?
I am normally using SQL Server 2012 Management Studio to restore a SQL Server database from a "bak" file. I do this by overwriting an existing database. In the "Options" page, there is a check-box labeled "Close existing connections to destination…

schlingel
- 1,514
- 2
- 15
- 24
66
votes
2 answers
how to backup a django db
I have a Django application that uses a Postgres database. I need to be able to backup and restore the db, both to ensure no data is lost and to be able to copy data from the production server to the development server during testing.
There seem to…

trubliphone
- 4,132
- 3
- 42
- 66
63
votes
7 answers
Restoring database from .mdf and .ldf files of SQL Server 2008
For some reason I have to uninstall SQL Server 2008 R2 but before that I copied two files (.mdf and .ldf) of my database from
C:\Program Files (x86)\Microsoft SQL Server\MSSQL10_50.MSSQL2008\MSSQL\DATA
Now, the question is, is it possible for me…

Ahsan Raza
- 739
- 1
- 5
- 3
61
votes
8 answers
How to restore PostgreSQL dump file into Postgres databases?
I have a dump file with a .SQL extension (in fact it is a plain-text SQL file). I want to restore it into my created databases. I am using pgAdmin III, and when I use its "Restore Wizard" it does not highlight the button "Restore". Instead it is…

Usman
- 2,742
- 4
- 44
- 82
39
votes
8 answers
postgresql- restoring .dump file
I am new for psql. I got from my server data.dump file. I need to restore it in my local.
I tried these commands.
i) psql -U postgres dbname -f servicedb.dump
Error:
psql: warning: extra command-line argument "-f" ignored
psql: warning:…

shahul
- 391
- 1
- 3
- 3
38
votes
5 answers
Enabling broker after Restoring Sql Server DataBase
I have DataBase with enabled Service Broker. Then I want to restore my database in program from backup of other database, but after restoring(I restore on existing database name), my method, whitch enables Service Broker, puts this error:
Msg…

vts123
- 1,736
- 6
- 27
- 41
38
votes
10 answers
Fully automated SQL Server Restore
I'm not very fluent with SQL Server commands.
I need a script to restore a database from a .bak file and move the logical_data and logical_log files to a specific path.
I can do:
restore filelistonly from disk='D:\backups\my_backup.bak'
This will…

hasen
- 161,647
- 65
- 194
- 231
37
votes
6 answers
Exclusive access could not be obtained because the database is in use
I'm using following code to restore databases,
void Restore(string ConnectionString, string DatabaseFullPath, string backUpPath)
{
string sRestore =
"USE [master] RESTORE DATABASE [" + DatabaseFullPath + "] FROM DISK = N'" + backUpPath +…

Mohammad Dayyan
- 21,578
- 41
- 164
- 232