How to move a repository to new local storage? #271
Replies: 1 comment
|
Here's the process I'd follow: 1. Add the new storage location in the UI first 2. Put BBS in maintenance mode 3. Copy the data with sudo rsync -aHP --info=progress2 /old/path/<agent_id>/ /new/path/<agent_id>/Preserve 4. Verify ownership ls -ld /new/path/<agent_id>
# should show: drwx------ bbs-<something>:bbs-<something>5. Update the database to point the repo(s) at the new location -- Find the new storage location id
SELECT id, path FROM storage_locations WHERE path = '/new/path';
-- For each repo you moved, point it at the new location
UPDATE repositories
SET storage_location_id = <new_id>,
path = REPLACE(path, '/old/path', '/new/path')
WHERE id = <repo_id>;The 6. Re-run the per-client storage path setup sudo /usr/local/bin/bbs-ssh-helper update-storage-paths <ssh_home_dir> /new/path/<agent_id>7. Turn maintenance mode off and trigger a test backup 8. Remove the old data A few things to watch out for:
A managed "move to new storage" workflow is on my list, but it's manual for now. Let me know if you hit a snag. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
What is the best way to move a repository from one filesystem path to a new path? I can see use of "rsync -avPH --progress /old/path/repos/ /new/path/repos/" will do a copy and preserve file attributes. Not sure of the best way to update the repository at the client level in BBS.
All reactions