Occasionally, you may have a svn repository that does not follow the recommend layout, probably because it seemed not worth the efforts when you first start that toy-like project. However as developments continue, that repository may have lots of commits, and you found it much convenient if there are the trunk/tags/branches layout (for example, link). Here I will give a step-by-step tutorial.
First, we need to dump the old repository with svnadmin, and then create a new clean repository.
svnadmin dump /srv/svn/repos/test > test-repo.dumpNext, check out the clean repository, and add trunk, tags, and branches directories.
mv /srv/svn/repos/test /srv/svn/repos/test-backup
svnadmin create /srv/svn/repos/test
svn checkout PATH-TO-TEST-REPOFinally, load the previous repository dump into the trunk subdirectory. Note, the --parent-dir is essential.
svn mkdir trunk tags branches
svn ci trunk tags branches -m "add trunk tags branches structure"
svnadmin load /srv/svn/repos/test --parent-dir trunk < test-repo.dumpDone!