Is it possible to copy schema, only, when creating a database image?

RedgateRossRedgateRoss Posts: 5 New member
HI everyone,

I have created several databse images using the the tool, with great success. RedGate Clone is a really great product

I am now looking to create a couple of images that that contain no data (Schema, only).

I believe that I can acheive this using the "Modifications" step by including a script to truncate all tables in the database. I have a couple of questions about this approach, though:


1. Are modification scripts applied to the image once it has been created, or is it done in memory while the image is being created?
2. Additionally, I'd just like to clarify that any modification scripts I use are only applied to the image and not the source database

The main reason I would like to take this approach is to save time: the database I would like to do this with is very large and takes a long time to copy. I only need the schema from the source database, so it would be great if i could find a solution to this

If this sounds like a bad idea, I am completely open to different approaches/advice.

If anyone has had any experience/success with this type of task, It would be great if you could let me know.

Thanks again for taking the time to read my question,
Ross
Tagged:

Answers

  • Hi Ross,

    Thanks for your feedback!

    Modification scripts are applied to the image once it's been created, but only to the image, not the source database. It would be safe to use a modification script to truncate the tables, but this probably wouldn't help that much in your situation unfortunately. Because the image is created including all the data before you truncate it, it will still take the same amount of time to create, and the image will also consume unnecessary disk space as it will remain at its largest size (we are considering adding functionality to compact images to address this second issue).

    SQL Clone operates mostly at the file level, so the workflow that I'd suggest for creating a schema-only image would be to create a blank database and use SQL Compare to compare the source database against it. You can then deploy the schema into the blank database and then use that database to create your image.

    Hope that's helpful,

    Chris
Sign In or Register to comment.