How do i do a simple backup and restore in SSIS?

I've been searching google and to my avail i've found nothing.  How do i do a simple Database Backup to Database A, and from the Backup File, restore it (incremental backups) to Database B using BIDS?  I just wanted to design a control flow to deal with thisSIRIUS

Hi,
To backup a database using SSIS, drag and drop a Execute SQL task onto your SSIS package designer. Double click on it and set the connection type to OLEDB. Set the Connection property to the Master datatabase, or any database for that matter, on your SQL server. The wizard is pretty simple and you should be able to follow it pretty easily.
Once done, click on the SQL Statement property of the package, and click the small ellipsis button. A new pop-up window opens. Copy and paste below script in the window, save the changes and you are done!!
Script to backup database:
-- Backup database to file
declare @backupFileName varchar(100), @backupDirectory varchar(100),
@databaseDataFilename varchar(100), @databaseLogFilename varchar(100),
@databaseDataFile varchar(100), @databaseLogFile varchar(100),
@databaseName varchar(100), @execSql varchar(1000)
-- Set the name of the database you want to backup
set @databaseName = 'myDatabase'
-- Set the path for a directory on SQL server machine where backup files will be stored after backup process
-- This can be a path of a shared folder on another machine as well, provided Write permissions are granted
-- on this folder.
set @backupDirectory = 'aboslute_path_to_backup_directory' -- such as 'c:\temp\'
-- Create the backup file name based on the backup directory, the database name and today's date
set @backupFileName = @backupDirectory + @databaseName + '-' + replace(convert(varchar, getdate(), 110), '-', '.') + '.bak'
-- Get the data file and its path
select @databaseDataFile = rtrim([Name]),
@databaseDataFilename = rtrim([Filename])
from master.dbo.sysaltfiles as files
inner join
master.dbo.sysfilegroups as groups
on
files.groupID = groups.groupID
where DBID = (
select dbid
from master.dbo.sysdatabases
where [Name] = @databaseName
-- Get the log file and its path
select @databaseLogFile = rtrim([Name]),
@databaseLogFilename = rtrim([Filename])
from master.dbo.sysaltfiles as files
where DBID = (
select dbid
from master.dbo.sysdatabases
where [Name] = @databaseName
and
groupID = 0
print 'Backing up "' + @databaseName + '" database to "' + @backupFileName + '" with '
print '  data file "' + @databaseDataFile + '" located at "' + @databaseDataFilename + '"'
print '  log file "' + @databaseLogFile + '" located at "' + @databaseLogFilename + '"'
set @execSql = '
backup database [' + @databaseName + ']
to disk = ''' + @backupFileName + '''
with
  noformat,
  noinit,
  name = ''' + @databaseName + ' backup'',
  norewind,
  nounload,
  skip'
exec(@execSql)
----------------------------------------------------------End of Backup Script-----------------------------------------
Note: You'll need to change the database name and the directory path in the above script as per your requirements.
Hope that helps.
Cheers!!
Muqadder.

Similar Messages

  • I have an iPhone 4, and I DESPISE iOS 7. I'm only 13, so too anxious to backup and restore for fear of losing apps and music. Any solutions on how to get back there without backup and restore? I'm desperate.

    I have an iPhone 4. I DESPISE iOS 7, I'm only 13 so
    I'm too nervous to backup and restore my phone for
    Fear of losing apps, music, notes, etc..
    Is there anyone out there who can help me get back
    With iOS 6 without the backup and restore? I'm desperate.

    Here are few tips to speed up your phone http://osxdaily.com/2013/09/23/ios-7-slow-speed-it-up/
    battery issues look here http://osxdaily.com/2013/09/19/ios-7-battery-life-fix/
    Also you can try settings - general - reset - reset network settings.

  • Backup and Restore of Redis Data

    My usage of Azure Redis is a cache to store snapshots of data for an event sourced system. We have millions of events stored in persistent storage that are aggregated and saved to redis. This provides us with fast access to the current state of an entity.
    However, to rebuild the Redis cache from scratch would take many hours as the number of events in the system is huge and constantly growing. 
    How in Azure Redis can we backup and restore data in case of failure? For instance, it would be nice to have access to an rdb file and archive it then restore when needed. We tried setting a non-Azure Redis as a slave of our Azure Redis however this does
    not work as it seems the Azure Redis doesn't have write access to it's working directory preventing it from writing an rdb file for sync.
    What are the recommended approaches to using Azure Redis as persistent storage? How can we backup/restore or even move data from one redis to another.
    Thanks!
    Drew 
    Drew Schaeffer

    Thanks for the response Mike. The interesting thing is on Saturday this didnt work. Today it looks like it is sync'ing succesfully. Below is the steps and output i saw on Saturday. I started it again today and it looks good so far. I will let it finish the
    sync and see what happens now. The redis is about 19gb on a Standard Pricing Tier.
    On the non-Azure Redis
    1. SET CONFIG masterauth <mykey>
    2. SLAVEOF myredis.redis.cache.windows.net 6379
    Then on my non-Azure Redis I see the following output. This ouput repeats until i kill the non-azure redis or set SLAVEOF NO ONE.
    [3468] 17 Jan 20:27:28.152 # Server started, Redis version 2.8.17
    [3468] 17 Jan 20:27:28.153 * The server is now ready to accept connections on port 6379
    [3468] 17 Jan 20:27:58.517 * SLAVE OF myredis.redis.cache.windows.net:6379 enabled (user request)
    [3468] 17 Jan 20:27:59.294 * Connecting to MASTER myredis.redis.cache.windows.net:6379
    [3468] 17 Jan 20:27:59.318 * MASTER <-> SLAVE sync started
    [3468] 17 Jan 20:27:59.322 * Non blocking connect for SYNC fired the event.
    [3468] 17 Jan 20:27:59.336 * Master replied to PING, replication can continue...
    [3468] 17 Jan 20:27:59.345 * Partial resynchronization not possible (no cached master)
    [3468] 17 Jan 20:27:59.348 * Full resync from master: ea5954fa6dcd0073585177b26c72f3e228309c2b:49968344771
    [3468] 17 Jan 20:28:23.207 # syncRead returned 0
    [3468] 17 Jan 20:28:23.208 # I/O error reading bulk count from MASTER: Resource temporarily unavailable
    Drew Schaeffer

  • Backup and Restore applications in NOKIA 5800

    Hi,
    i did a full backup using ovi suite, and when i did restore it didn't restore all of my applications.
    when u do a backup, it's supposed to backup all the applications you have on the phone, right?
    i didn't get any error when doing backup or restore.
    also, almost all of my applications are installed on the memory card.
    how can i make it to backup and restore the applications?
    Thanks,
    Erez.

    The following resources will help you:
    Using the Microsoft Outlook Personal Folders Backup tool
    How to manage .pst files in Outlook 2007, in Outlook 2003, and in Outlook 2002
    Backup/Restore Email from Outlook 2003

  • BW Backup and Restore

    Gurus,
    I am working on how we can do the BW backup and Restore strategy.
    If anyone has done this before or any good document to share, please let me know.
    Thanks a lot.

    Work with your BASIS guys and ask them what are their plans of refreshing systems in landscape. What happens is actually productions is copied on QA and most of the time QA works as a back as far as config is concerned.
    There may be database back up as well, and BASIS guys should be leading that. Most of the organizations have landscape wise (BW, R/3 etc) backup and restore plans.
    Hope it helps
    Vikash

  • Iphone4 would not restore Error -50. I have tried to restore and it restored it to the point that it created after 5.0 was installed. How can I get it an older restore point from my backups and restore it on another computer? The phone has been wiped out.

    Iphone would not restore---- Error -50. I have tried to restore, and it restored it to the new point that it created after 5.0 was installed. How can I get it an older restore point from my backups and restore it on another computer? The phone has been wiped out. I can see earlier backups in my C:\Documents and Settings\user\Application Data\Apple Computer\MobileSync\Backup folder. There are four subfolders in this address. I need my contacts, photos, and messages back. I know this is a common error but I can not figure it out. I have ran the other troublshoot items in the error steps for 13 and 14 like apple says. Is there a way to call apple and get a step by step of how to restore from another restore point? Does anybody have a solution????

    It tells you to go to Error 13 and 14 if you receive error (-50).
    Here is what I have tried...
    Error 13 and 14: These errors are typically resolved by performing one or more of the steps listed below:
    Perform USB isolation troubleshooting, including trying a different USB port directly on the computer. See the advanced steps below for USB troubleshooting. I have moved it around to different ports.
    Put a USB 2.0 hub between the device and the computer. Didn't change anything.
    Try a different USB 30-pin dock-connector cable.
    Eliminate third-party security software conflicts. Removed all virus protection and firewall.
    There may be third-party software installed that modifies your default packet size in Windows by inserting one or more TcpWindowSize entries into your registry. Your default packet size being set incorrectly can cause this error. Contact the manufacturer of the software that installed the packet-size modification for assistance. Or, follow this article by Microsoft: How to reset Internet Protocol (TCP/IP) to reset the packet size back to the default for Windows.Used the Microsoft fix it.
    Connect your computer directly to your Internet source, bypassing any routers, hubs, or switches. You may need to restart your computer and modem to get online. Doesn't matter.
    Try to restore from another known-good computer and network. I do not know how to do this or how to find the correct/full/complete restore point. There should be more information for this.

  • HT1766 Now, I understand how the backup and restore the backup functions. However, if I don't want to transfer the music that I have on iTunes to my phone, how do I avoid it? How do I not transfer the music or take it out of my iPhone if it is already the

    Now, I understand how the backup and restore the backup features function. However, if I don't want to transfer the music that I have on iTunes to my phone, how do I avoid it? How do I not transfer the music or take it out of my iPhone if it is already there? I really do not want any music on my iPhone because I have an iPod for that. Thanks. Hope someone can help.

    When you connect your phone and start iTunes on the left side you will see your phone listed under devices.Click on te icon next to it that looks like a battery. Click on the music button at the top and uncheck the sync music box.

  • How to backup and restore working Mac OS 9 computer ?

    I have a working G4 running OS 9.0, and I would like to backup and restore that hard disk to a second G4 computer that is OS 9 bootable.
    I have a CD backup taken by Toast v4, of the entire disk, but I do not know how to restore the contents to the second computer. My previous attempt hosed the hard disk inside the second computer.
    I'm thinking I can boot up the second computer via cd-rom or external hard disk, but I'm not sure I can copy the contents from the cd-rom correctly. In particular, I'm guessing the boot sector is challenging to restore.
    I probably have some old OS 9 cd-roms around here, if I need to go that route.
    I've thought about removing the working hard disk, and using dd on a linux machine to make a clone of the drive. I'd prefer not to go that route, as I don't want to touch working hardware.
    I've also thought about hooking up a portable USB disk drive to my working OS 9 machine, and doing some sort of cloning. I'm not sure what program I would need to do that, and whether it's part of the OS 9 suite of tools, or a 3rd party tool. I used to own some various disk tools, but it's been so long I'm not sure I can find the cd's.
    So if anybody can point to some instructions on the net for me to follow, or have any suggestions, I'm all ears.
    Thanks
    mark

    If the second computer originally shipped supporting a newer OS 9.x
    system than the first 9.0, the other computer's OS9 version probably
    won't work since it would be too old. In the case of drag and drop,
    you can get away with a lot more than what an installer package may
    allow, since the installer's software can be avoided with Pacifist. So
    another computer's OS9.2.2 basic system could be used as a boot
    volume even if it is sparse and not the fully complemented OS 9.2.2
    that a full retail build would install from a rich full retail install disc.
    Usually the retail path was an OS 9.2.1 retail and the update to 9.2.2;
    but machines requiring OS 9.2.2 won't like a 9.2.1. Sometimes, since
    a drag and drop is not driven by installer software, you can use older.
    But machine specific bits, some critical for graphic card drivers & etc,
    would be likely missing unless the software used offered that support.
    If you can find one of these, it may work = note, out of stock:
    691-3638-A Apple G3/G4 9.2.2 (CD) System Software
    {This is a Mac OS 9.2.2 full installation CD, color Grey.}
    These do not come in retail packaging.
    http://www.welovemacs.com/6913638a.html
    Have fun, even if it isn't exactly as planned.
    Good luck & happy computing!
    { edited }

  • TS3198 After doing the backup and restore how do you know if the phone is unlocked if you do not get the message: "Unlock Complete. Congratulations, your iPhone has been unlocked. To set up and sync this iPhone, click Continue."

    After doing the backup and restore how do you know if the iphone is unlocked if you do not get the message: "Unlock Complete. Congratulations, your iPhone has been unlocked. To set up and sync this iPhone, click Continue."

    If you don't get the message, your phone is NOT unlocked.

  • How to backup and restore in sap ECC 6.0  EHP 6 in HANA database

    how to backup and restore in sap ECC 6.0  EHP 6 in HANA database

    Stop loading your interview questions here - otherwise your user ID will be deleted.
    Thread locked!

  • How to Backup and Restore Apex 4.0

    Hi all,
    How to backup an application with all its shared component?
    The objective of this backup is to undo the changes I made, and also to restore it in another machine.
    Thanks
    Siera
    Edited by: user11976229 on Oct 8, 2010 11:12 AM
    Edited by: user11976229 on Oct 8, 2010 11:12 AM

    Hi all,
    Kindly help me with this backup and restore doubt.
    Currently my understanding to backup is as follow
    1. Database Cold backup, backup dads file Restore -> rebuild 100% after installed oracle db
    2. Export with parameter Fromuser = [the workspace schema] Restore -> import to db
    3. Using Apex Export Function Doubt -> this one look like not covering the data. ?>> this one only create the skeleton of the apps but no data? how about the apps objects such as trigger (sequences)
    Kindly help me to understand the backup and recovery
    Thank you for your time.
    Regards,
    Siera
    Edited by: user11976229 on Oct 8, 2010 11:11 AM

  • How to Takes Active directory backup and Restore in different Hardware

    Hi 
    how to takes Active directory backup and Restore in different Hardware in Windows server 2003 R2 standard Edition.

    You can give a look to that: https://support.microsoft.com/kb/249694/?wa=wsignin1.0
    This posting is provided AS IS with no warranties or guarantees , and confers no rights.
    Ahmed MALEK
    My Website Link
    My Linkedin Profile
    My MVP Profile

  • How to backup and Restore in 8.1.7 Database

    Hi,
    I wanted to have complete backup and restore of 8.1.7 database. how can i achieve this. The steps in Oracle Management Server and scripts for the same.
    Also, how can i backup and restore contents of an user of database which has tablespaces and sequences. Again i need the step in Oracle Management Server and scripts.
    It will be more helpful if scripts are provided.
    Thanks in advance.
    Vikram

    Stop loading your interview questions here - otherwise your user ID will be deleted.
    Thread locked!

  • How to backup and restore iTunes library?

    I've had to transfer my iTunes library to a new computer a few times in the past and I've run into this problem. I lose all my playlist information etc. and have to re-create it. If there's some utility that assists in restoring ALL the meta data in the iTunes library I'll pay money for this...
    Thanks,
    Kevin.

    OK, while that is good for what most people want to do it isn't good enough for what I want to do. It doesn't cover the two requirements that I need:
    1. I want to keep some music files in a different folder. I don't want iTunes to manage these files.
    2. The source path may be different from the target path. i.e. on my old machine it was D:\Music\... but on the new machine it was C:\Music\... (and I've even changed sub-folders in the past to better organize things).
    The article you referred to requires that I either:
    1. Get iTunes to manage my music.
    2. OR copy my files to the same path (I didn't even have a C: drive!!!!)
    I've actually written my own utility that hacks around this issue but it screws up playlists so it isn't perfect. I just don't have the time or patience to figure out exactly how Apple processes its XML file format (they made it harder in one version of iTunes because it now uses the .itl file when it used to simply pick up the changes I made to the .xml file itself).
    So, I now want someone else to go to the effort of doing this and I'll pay something to buy their utility if it works well. I imagine there are probably other customers out there for this type of utility.
    Ideally, Apple should provide a "Backup" and "Restore" menu item that would handle this kind of thing for us and prompt us for destination path mappings when the "Restore" feature is used.
    So... does anyone else know of a utility to do this or if Apple is going to provide this in the not-too-distant future?
    Thanks,
    Kevin.

  • How to backup and restore iPhone 4

    how to backup and restore iphone 4

    How to back up: http://support.apple.com/kb/HT1766.
    How to restore: http://support.apple.com/kb/ht1414.

Maybe you are looking for

  • Hp deskjet 1510 multiple copies

    My HP Deskjet 1510 keeps making multiple copies of itself in my devices on windows 7. I've tried deleting the copies but they keep coming back can anyone help please for some reason its stopped letting me print.

  • Printing versions

    I am relatively new to Aperture and thus far have found the editing tools and organizational abilities with Aperture to be great. My question is related to dealing with edited Masters, or versions of my original file and how to upload those files to

  • Want a gallery effect something like...

    hey, i am newbie to spry and to javascript. i want to use this effect( http://www.iexplorehere.com/image-gallery/11111.html ) in my gallery. whenever a user clicks on an image in my xml generated gallery, a new window pops up and background turns bla

  • Header of custom infotype

    Hi, I have created a custom PA infotype and my requirement is that I do not want the standard SAP header and want to display my own header fields. Is it possible to delete the SAP header? will that cause any problem? Thanks, Harini

  • I have a jpeg icon & a question mark appearing on all Finder header bars. How do I remove them?

    Don't know where they have come from. How do I get rid of them?