svnadmin dump and svnadmin load are the right tools. If the paths in repo1/ (full history) are disjoint from the paths in repo1/.../mydirgrandchild/ (head revision), then the following steps should do the job:
svnadmin dump /path/to/repo1 > /tmp/repo1.dump
svnadmin load --parent-dir mydir/mydir/mydirgrandchild /path/to/repo2 < /tmp/repo1.dump
It the paths are not disjoint, then you should change the paths in the dump before loading it into repo2. See the following links for more information:
- Is it possible to change dir name in repository by svndumpfilter?
- https://metacpan.org/pod/distribution/SVN-DumpReloc/bin/svn-dump-reloc
To minimize the risk of data corruption, you should test the second step before running it on your real SVN repository. That means you should first create an exact copy of repo2. You can use file system tools for this task (e.g. cp -a
). Don't forget to check if there are absolute paths hardcoded in the hook scripts.