After spending a time looking for an answer for my question, i decided to ask for help.
I have a dump file, from postgres back and need to upload this for a SQL Server database.
First choice: installed a PostgreSQL server, restored the dump file, odbc conector for ETL Process in SSDT and worked fine and nice. Negative points: Backup restoring a little bit slow. Need to restore backup out of SSDT, so process is not completely automated.
What I seek as an alternative: A script task, or some other alternative, to read the dump file and convert this for CSV files. Not success in this alternative.
Other choice: An ODBC conector to read the dump file directly in SSDT and upload this to my SQL Server directly, also, unsuccessful.
Do you have any other option for me, considering that I would like to keep PostgreSQL out of this possibility. Would like to use, just SSDT and SQL Server.
Upload data from Psql dump file, direclty to SQL Server.
Related
I am trying to restore a database from the backup (.bak) file which is [saved] inside a ZIP file, but not been successful so far. However, I am able to restore it after extracting from the ZIP file.
This MS page says every edition of SQL Server 2008 and later can restore a compressed backup with the following restrictions.
Restrictions: The following restrictions apply to compressed backups:
Compressed and uncompressed backups cannot co-exist in a media set.
Previous versions of SQL Server cannot read compressed backups.
NTbackups cannot share a tape with compressed SQL Server backups.
I do not clearly understand the first restriction. Could someone please clarify/elaborate this?
I have done the following steps:
Taken a backup on a staging SQL Server [MyTestDB.bak]; Compressed it (by Right Click > Send To - Compressed(zipped) folder); Now, named it as MyTestDB.ZIP
FTP'd the ZIP file to local development SQL Server and trying to restore it from the ZIP file. But the database name is not available to backup.
Both SQL Server versions are exactly same.
SQL Servers Version: Microsoft SQL Server 2012 - 11.0.5058.0 (X64)-Standard Edition (64-bit)
Would the usage of term 'compressed backup' for the backup files saved inside ZIP files is correct or Is this need to be backed up in a different way so it can be called as a compressed backup?
However, if I select the .bak file after extracting it from the ZIP file it all works fine.
I am not sure where I am going wrong? I can simply extract the backup and restore it without any problem, but would like to know the cause why it is not working, as it would have been a much better solution to just back up it from the ZIP itself.
Backup compression is something different.
You specify this when you configure or start the backup and you then get a backup file that contains compressed data, as opposed to it containing uncompressed data if you don't enable compression.
SQL Server is not able to use a zip file, while the backup file is certainly compressed, it is not a "compressed backup" that this refers to.
So yes, you need to extract the backup file before restoring from it.
If you want to learn how to make compressed backups correctly, check out this page full of links to related material:
Configure Backup Compression
Generally to get the meta data from SQL Server backup files, we need to use TSQL commands like restore headeronly or restore filelistonly. However, there are some third party tools can read this information directly from the backup files, like this one http://www.yohz.com/sqlbakreader_details.htm. Since this tool don't have a command line version, which makes it less useful. I want to know whether there are some ways that I can read this data directly.
Thanks.
The .bak file is a Microsoft Tape Format file. Here's a PDF that contains the format.
Of interest to you will be:
For a quick dump (if you are on the SQL Server in question that created the backup), you can do select from the [msdb].[dbo].[backup*] tables.
See this article for more info.
I think you may be able to use SQL Servers SMO libraries and write your own in .net or Powershell. If you take a look at this page http://msdn.microsoft.com/en-us/library/microsoft.sqlserver.management.smo.restore.readbackupheader.aspx there are code samples in VB.Net and Powershell.
Ok so I have a .bak file which is a backup of our old CRM data. This has come from a backup of an SQL SErver database (not sure what version). What I am trying to achieve is converting all the data that file contains in a .CSV that I can then use to import the data into a different CRM.
I have tried the obvious things, renaming the file .csv and trying various text editors and applications that claim to be able to view these kind of files. All I ever get is a ton of gibberish, by that I mean a ton of characters and symbols that clearly do not represent what is in the data backup.
From what I have obtained already, I need to restore this file to an SQL Server database, and then do the export to .csv. I have managed to set up a trial version of SQL server 2012, however when I try to import the file (import from flat file option), when I get to the preview, it appears to just be gibberish populating the fields again, and if I then run that anyway, its fails and returns errors. I can confirm that another CRM company had managed to restore this and extract what they needed, sadly we decided not to continue with them, but based on that, I would say the .bak file is not corrupted.
I assume I am doing something wrong. My question is what is the correct way to import / restore a .bak file into MS SQL 2012?
Is there an alternative that I have missed or is this not the right approach to begin with?
Any help greatly appreciated as always!
I recently needed to convert a MS SQL Server database backup in .BAK format to anything digestible by other tools such as CSV, SQL. The only thing I found was online converter RebaseData. It's free for smaller file sizes, up to 10MByte.
For SQL Server, we are able to send over the db for the most part pretty easily to offshore staff.
Is this possible with the AS/400 or they can only VPN in to work?
Every database engine has a slightly different version of SQL. DB2 for i at V5R4 has differences to DB2 LUW 9.7 and both are different to SQL Server and MySQL at any version. So the quick answer is no, you can't simply make a copy of a DB2 for i database and run it on MySQL or SQL Server. You'd normally do exactly as you are doing with SQL Server: Have one machine here and another machine there and unload/reload the data as needed.
Having said that, the differences between SQL dialects are not usually crippling. Use the IBM Navigator for i and extract all of the DDL for the IBM database, then try to execute the DDL on the SQL Server machine. You'll have some syntax problems, but you should be able to work them out with someone who is knowledgeable in both dialects. Keep track of the changes to the DDL because you'll need them in order to extract the data from the IBM side.
Once you have the empty database created on the new machine, it's time to extract out the data. Write some CL programs to do CPYTOIMPF to generate CSV files or flat files or whatever it is that SQL Server wants in order to import properly. Then FTP that data to the new machine and write some scripts to do the import.
As you can tell, this is not going to be a simple process and it will take some time to develop and debug. I'd go with having the offshore staff using a VPN to the local IBM machine.
The easiest way I can think of would be to create a Save File (SAVF) then FTP that save file to the other IBM i and [restore it] (http://pic.dhe.ibm.com/infocenter/iseries/v6r1m0/index.jsp?topic=/cl/rstobj.htm).
In the PC world this is similar to zipping up a directory, FTPing it to another machine and then unzipping it.
If this isn't what you mean, can you elaborate on what you're wanting?
The offshore site probably has their own SQL Server, probably running the same version as you.
But unless they also have an IBM Power System running the same release of IBM i, then they will most likely need to access your system.
I'm using MSI Project with InstallShield 2010.
I have a .bak file, a backup of a SQL database (I am using SQL Server 2008 R2). How can I restore it using InstallShield?
I was looking in SQL Scripts tab and I didn't find anything about restoring backups.
Thanks for your time!
Technically you could use a SQL script to restore the .BAK file but this isn't really the best practice. What you are supposed to do is "script out" the database into one or many SQL files and execute those files to create your database during the install.
say suppose you have xyz.bak as a bakup and you want to restore it on to your sqlserver 2008r2 try running following query in ssms
Restore database DatabaseName from disk='path of your bak file'
this will restore your database.
In hopes of getting an answer to this thread's original question, let's say that building up the database via the "script out" approach would take way too long to perform at install-time.
Scripted out, the database I am working with takes ~90 min to get built up. Restoring a 1.6 GB compressed .bak takes ~90 sec.
I am interested in restoring a .bak as part of my IS2010 msi project. Currently CAs are used but a more elegant solution (especially one that can provide progress back to the user) would be more ideal.