RFS Synchronization
Cschoenfeld (Talk | contribs) (Added notice about danger of working copy corruption during sychronization) |
Cschoenfeld (Talk | contribs) (added info about synchlist and added hints) |
||
Line 9: | Line 9: | ||
A disadvantage of this method is that if you decide to synchronize a directory which is under version control OpenCms will also import any files or folders your SCM software uses to store metadata about your working directory, e.g. .svn and CVS. If that happens, be careful not to delete the folders in the VFS. Otherwise, the next time you start a synchronization, OpenCms will delete them from RFS and thus corrupt your working copy. | A disadvantage of this method is that if you decide to synchronize a directory which is under version control OpenCms will also import any files or folders your SCM software uses to store metadata about your working directory, e.g. .svn and CVS. If that happens, be careful not to delete the folders in the VFS. Otherwise, the next time you start a synchronization, OpenCms will delete them from RFS and thus corrupt your working copy. | ||
+ | |||
+ | '''#synclist.txt''' | ||
+ | OpenCms creates a file <tt>#synchlist.txt</tt> in the synchronization folder (e.g. <tt>build</tt>). It contains names and timestamps of all files of the last synchronization run and is the basis to determine changes when synchronization is called again. You need to take care not to delete this file by mistake when you clean your build. If you do, the next synchronization with OpenCms will not work correctly. You will have to build and synchronize again to get it back working. | ||
+ | |||
+ | == Hints == | ||
+ | If you start synchronization when your RFS synchronization directory is empty OpenCms will copy all files from all VFS directories part of the synchronization settings to the RFS. If you notice that this happened, do not delete the files from the RFS. They would be deleted from the VFS too when you do the next synchronization because OpenCms remembers everything in the <tt>#synchlist.txt</tt> file. It will remove all files from VFS which are mentioned in <tt>#synchlist.txt</tt> but not on the RFS. This can be harmful. | ||
+ | |||
+ | To avoid this problem you should avoid to synchronize directories which already exist in the initial OpenCms. Only synchronize directories that you created and which are part of the build with which you want to synchronize. Otherwise, you will lose files and might need to reinstall OpenCms. |
Revision as of 14:57, 2 December 2006
Synchronizing RFS and VFS
During development it is very useful to synchronize the VFS (the virtual file system of OpenCms, located in the database) with a directory in the RFS (real file system on your disk where you develop stuff).
You will probably not want to develop all files directly within the OpenCms Administration UI. Firstly, because the source editor does not support syntax highlighting. Secondly, because the files in the VFS are outside of your version control system.
Here is a forum post which describes how to set up synchronization.
That way you can develop files on your disk under version control, within your favourite IDE and use the synchronization function to update the changes within OpenCms. However, if you change Java code, library dependencies or classpath resources, you will have to reload the OpenCms web application or even restart your servlet engine.
A disadvantage of this method is that if you decide to synchronize a directory which is under version control OpenCms will also import any files or folders your SCM software uses to store metadata about your working directory, e.g. .svn and CVS. If that happens, be careful not to delete the folders in the VFS. Otherwise, the next time you start a synchronization, OpenCms will delete them from RFS and thus corrupt your working copy.
#synclist.txt OpenCms creates a file #synchlist.txt in the synchronization folder (e.g. build). It contains names and timestamps of all files of the last synchronization run and is the basis to determine changes when synchronization is called again. You need to take care not to delete this file by mistake when you clean your build. If you do, the next synchronization with OpenCms will not work correctly. You will have to build and synchronize again to get it back working.
Hints
If you start synchronization when your RFS synchronization directory is empty OpenCms will copy all files from all VFS directories part of the synchronization settings to the RFS. If you notice that this happened, do not delete the files from the RFS. They would be deleted from the VFS too when you do the next synchronization because OpenCms remembers everything in the #synchlist.txt file. It will remove all files from VFS which are mentioned in #synchlist.txt but not on the RFS. This can be harmful.
To avoid this problem you should avoid to synchronize directories which already exist in the initial OpenCms. Only synchronize directories that you created and which are part of the build with which you want to synchronize. Otherwise, you will lose files and might need to reinstall OpenCms.