Renaming repository

Hi everyone,

I have a question regarding a repository I created for a client. The repository contains almost 500GB in total, but my backup disk only has 100GB of free space.

Originally, I set up a “testing” repo to try the process from scratch. However, the client now says we cannot stop their production environment to repeat the process in the “real” repo, bc creating the initial backup without parent snapshots would take too long.

As far as I can tell, there’s no way to “move” a repository using “restic commands” (please correct me if I’m wrong), and doing a “copy” would require more free space than I have. My goal is simply to rename the “testing” repository to the client’s actual name.

Here’s what I tried:

# Initialize repository
restic -r sftp:$host_repo@xxxx-bkp.local:/data/$host_repo/testing  init

# Create file
touch /tmp/borrar.txt

# Back up the file
restic -r sftp:$host_repo@xxxx-bkp.local:/data/$host_repo/testing backup /tmp/borrar.txt

# Edit the file
nano /tmp/borrar.txt

Then, in the SFTP directory, I did the following:

cd /data/xxxx.xxxx.net

# Rename the folder 
mv testing/ testing2

Then, back in the client’s server:

# Back up the modified file to the new folder name
restic -r sftp:$host_repo@xxxx-bkp.local:/data/$host_repo/testing2 backup /tmp/borrar.txt

# Restore the file
restic -r sftp:$host_repo@xxxx-bkp.local:/data/$host_repo/testing2 restore 6e84ccc7 --target /home

# Check the contents
nano /home/tmp/borrar.txt

This seems to work, but I was wondering if there’s a better solution, or if what I did is already good enough. Could this approach cause issues in the future? I’m not sure if this is considered standard practice.

Any advice would be greatly appreciated!

A restic repository does not have a name, so what you did (renaming it’s directory) is totally fine.

1 Like

oh thank u then!