restore

PostgreSQL: database restore from dump - syntax error

喜夏-厌秋 提交于 2019-12-02 15:51:54
I'm trying to restore a PostgreSQL database by executing the SQL that pg_dump created, on an empty database. I'm getting this error: ERROR: syntax error at or near "\" LINE 5211: \. lines 5210 and 5211 read: COPY auth_group (id, name) FROM stdin; \. It works fine on my Linux server, where I use this command: psql -U dbname < dumpfile.sql but on Windows, I'm not sure how to do the same, so I've been trying to run the dumpfile's sql from pgAdminIII query utility. What the recommended way of importing a db from a dump on Windows? Or: how can that syntax issue be resolve? Any help is much

SQL Server Restore Error - Access is Denied

£可爱£侵袭症+ 提交于 2019-12-02 15:47:52
I created a database on my local machine and then did a backup called tables.bak of table DataLabTables . I moved that backup to a remote machine without that table and tried to do a restore but get the following error: System.Data.SqlClient.SqlError: The operating system returned the error '5(Access is denied.)' while attempting 'RestoreContainer::ValidateTargetForCreation' on 'c:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DataLabTables.mdf'. How do I fix my rights, if that is the problem? Exile I have just had this issue with SQL Server 2012. It turns out all I had to do was tick the

Restore deleted Eclipse Project

蹲街弑〆低调 提交于 2019-12-02 14:01:32
问题 I wanted to make a new git repository in eclipse and when I was deleting the old one, unluckily the whole project has been deletet from the workspace! Is there any way to restore the project? I would appreciate your answer!!! 回答1: If you have another repository with your work (like a central git server,another developer, another computer or something like that) you can just clone your repository back from that: File -> Import -> Projects from Git -> URI -> Type in your server/the other

How to save/restore Sublime Text 2 configs/plugins to migrate to another computer?

穿精又带淫゛_ 提交于 2019-12-02 13:46:25
I need to migrate from one Mac to another, and want Sublime Text 2 on a new computer to have all the same configuration/plugins I have installed on the old one. Is there some folder(s) I could just copy and restore on another one to replicate everything? jdc0589 I just set up a good solution for this, it requires dropbox. I am currently using this to sync plugins and settings across ~5 different sublime installs on windows, linux, osx, and a few vm's. Step 1: use PackageControl to manage all your plugins, its awesome. Step 2: Add a "Sublime" directory to your root drop-box directory (I

Core Data. How to swap NSPersistentStores and inform NSFetchedResultsController?

一个人想着一个人 提交于 2019-12-02 12:04:47
I'm implementing backup and restore (via Dropbox) of a user's Core Data persisted data. For a restore I pull the files down from Dropbox and store them temporarily in the Documents directory. Then I create a new NSPersistentContainer and use it to replace the current persistent store (in the ApplicationSupport directory) before deleting the no longer needed files in the Documents directory. I'm using the MasterDetail template for now and so I have the usual time-stamped entities and the NSFetchedResultsController that comes along with that. Having made the replacement I swap back to the master

SQL Server: Database stuck in “Restoring” state with PHP

扶醉桌前 提交于 2019-12-02 07:22:17
问题 I tried to backup my database following the instruction from SQL Server: Database stuck in "Restoring" state. but i have my database stuck in "Restoring" state. php code below: $database = "container"; $uid = "sa"; $pwd = "12345" ; try { $conn = new PDO( "sqlsrv:Server=localhost\SQLEXPRESS;Database=$database", $uid, $pwd //,array(PDO::ATTR_PERSISTENT => true) ); $conn->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION ); } catch( PDOException $e ) { die( "Error connecting to SQL Server"

SQL Server: Database stuck in “Restoring” state with PHP

眉间皱痕 提交于 2019-12-02 05:42:56
I tried to backup my database following the instruction from SQL Server: Database stuck in "Restoring" state . but i have my database stuck in "Restoring" state. php code below: $database = "container"; $uid = "sa"; $pwd = "12345" ; try { $conn = new PDO( "sqlsrv:Server=localhost\SQLEXPRESS;Database=$database", $uid, $pwd //,array(PDO::ATTR_PERSISTENT => true) ); $conn->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION ); } catch( PDOException $e ) { die( "Error connecting to SQL Server" ); } echo "Connected to SQL Server\n"; $backfile = 'C:\Program Files\Microsoft SQL Server\MSSQL.1

Is it possible to restore only the schema and stored procedures from a MS SQL database backup?

社会主义新天地 提交于 2019-12-01 22:15:45
问题 I have a full MS SQL Backup file that I would like to extract the stored procedures and schema from. Is there a way to restore only the schema definitions and stored procedures without restoring the data/table rows? 回答1: I don't think so, but you could restore it to a temporary database and then script it all from there. 回答2: Yes its possible in SQL Server 2012. Right click your database -> tasks -> generate scritps ... Here all options are available. 回答3: What SQL Server version (and tools)

Rails: Restoring contents of non-model form that uses form_tag

跟風遠走 提交于 2019-12-01 18:37:24
问题 I'm making good progress with my first Rails app (using Rails 3). The MVC interaction is all going fine, but I'm having difficulty with a form that doesn't relate directly to a model. I'm using form_tag, and in the case of success, everything behaves fine. However, the handling of errors is somewhat unfriendly. The actual error message is stored in the flash and displayed fine by layouts/application.html, but I'd really like it if the form could remember the contents that the user had just

Rails: Restoring contents of non-model form that uses form_tag

旧城冷巷雨未停 提交于 2019-12-01 18:13:36
I'm making good progress with my first Rails app (using Rails 3). The MVC interaction is all going fine, but I'm having difficulty with a form that doesn't relate directly to a model. I'm using form_tag, and in the case of success, everything behaves fine. However, the handling of errors is somewhat unfriendly. The actual error message is stored in the flash and displayed fine by layouts/application.html, but I'd really like it if the form could remember the contents that the user had just filled in. But it doesn't: all the fields reset to their default values. I love the way that forms for