- With FTP, you upload / edit replace software files manually. If you edit a file, and later upgrade your site, you will lose your customization.
- With SVN, each software file is tracked, including any edits to the files. And thus, your changes are merged into the update.
Context: you are taking over a Tiki site which was installed by FTP, and you now want to use SVN for easy future upgrades. You may also have some modified files, and via FTP, it's time consuming to manage this.
On this example we will upgrade from version 12.9 (which is tagged as such in SVN) to branch 15.x of branches/15.x.
We assume you are familiar with Get code.
- website: http://tikiconvert.docker/
- document root: /var/www/virtual/tikiconvert.docker/html
1. Create a folder to place your backups
cd /var/www/virtual/tikiconvert.docker/ mkdir backup
2. Backup your database
eval $(sed -n '/^\$/s/^\$//p' html/db/local.php) mysqldump -u$user_tiki \ -p$pass_tiki \ -h$host_tiki $dbs_tiki \ | gzip > backup/$dbversion_tiki.sql.gz
3. Backup you current folder
tar -czvf backup/html.tar.gz html
svn co https://svn.code.sf.net/p/tikiwiki/code/tags/12.9 newinstall
When you did the checkout, SVN actually made two copies of each file. One as a working copy and one as a reference. ex.: /changelog.txt and /.svn/text-base/changelog.txt.svn-base This is very useful to make rapid diffs.
So as you copy your old site over the new install, if there are any modified or new files, they will override the ones of your checkout (the working copy but not the reference files in .svn/ folders).
cp -a html/. newinstall/
svn st newinstall svn diff newinstall
If svn shows modified files, you should solve that before continue.
1. Update source code
cd newinstall svn switch https://svn.code.sf.net/p/tikiwiki/code/branches/15.x composer install
2. Fix permissions
sudo chown -R http html
3. Update database
php console.php database:update
cd /var/www/virtual/tikiconvert.docker mv html tiki12 && mv newinstall html
Browse your website and check features you use are ok, after that remove
tiki12 folder, but stick with your backup!
rm -Rf tiki12