Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add "WITH MOVE" configuration to database restore #593

Open
franhoey opened this issue Oct 25, 2024 · 1 comment
Open

Add "WITH MOVE" configuration to database restore #593

franhoey opened this issue Oct 25, 2024 · 1 comment

Comments

@franhoey
Copy link

Is your feature request related to a problem? Please describe.
When restoring MS SQL Server databases the log and data files are restored to the same file location they held on the computer where the backup was made. If the database is restored to a different computer and the folder structure defined by the original file locations do not exist, the restore fails.
This becomes an issue when working in a team who do not have a standard setup or restoring data between local machines and alternatively configured test or production environment servers. Or in my case when I tried to execute the restore on a newly built laptop.

Describe the solution you'd like
This is tricky, because grate needs to be agnostic to database type.
My suggestion is to allow a mix of data formats to the Restore configuration item. Either a simple string as it currently is to the backup file, or a structured string similar to the Folder configuration (name-value separated by semi-colon) to add additional parameters e.g. "file=C:/path/file.bak;move=database|D:/data/filename.mdf;move=database_log|D:/logs/filename.ldf"

Describe alternatives you've considered
We could use JSON in the configuration value, but this hasn't been used in other configurations
New configurations could be added e.g. RestoreMove, but this would then be specific to MS SQL Server, where as a configuration string format in the Restore configuration setting would allow specific config to be used on other database types in the future

Additional context
N/A

@franhoey
Copy link
Author

I get time in my job when things are slow I could use to complete this issue it that is helpful

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant