# Navigation Data Backup

### Saving sessions

- The navobj.xml.[1..x] takes care of your session data backup. This means that when you start OpenCPN it “remembers” the state of your last session.
- A rotating backup of navobjects is automatically created on every program run. OpenCPN keeps backups of the last 5 runs. This can be changed.
- Change the number of navobject backups. In the opencpn.ini/opencpn.config file you can find a Configuration Setting to control the number of backups kept, defaulting to KeepNavobjBackups=5. This value can be changed using a text editor.
- The backups are then stored in files navobj.xml.[1..x] (in the same directory as the ini file) where .1 is always the newest backup and the oldest is removed on the next program run. The file that will be loaded on next start is called navobj.xml.
- The backups are only rotated if the navobj.xml file has changed since the last backup was created. This prevents overwriting good backups with a broken version, more than once.
- Note that the navobj.xml files reside in a folder that is hidden by default by Windows. More information is available here: OpenCPN Installation.
- To load an old backup, exit the program. Find the backup you want to use. Rename it navobj.xml. Start OpenCPN!
- The navobj.xml.[1..x] files are gpx files and it is also possible to directly import them back into OpenCPN. Press the “Import GPX” button in the Route Manager.

### Upgrading OpenCPN

- Navobjects are not lost during a normal upgrade to a newer version.

### If trouble strikes...

- You have useful automatic rolling backups of navobj.xml, as described above.
- Copy them somewhere safe before you run OpenCPN again, as they are automatically rolled over, and you lose the oldest one for each invocation of OpenCPN.
- Rename the “best” one as navobj.xml, and the contents will be automatically used by OCPN.
- The OpenCPN logfile also serves as a backup through the “LOGBOOK:” entries.
- These can be used to reconstruct a GPX track. A windows utility for hat purpose is available here: https://github.com/nohal/LogBookExtractor/downloads

### Saving waypoints, routes, tracks and layers for future use.

- For a more permanent backup solution, to keep routes, waypoints and tracks etc, that you may need in the future, consider saving the data by using Route & Mark Manager or use Layers
- Be organized. Create a dedicated directory, for example GPX_Routes, to save files worth keeping. Be careful to name all files in a manner so the content is obvious, without having to import the file into OpenCPN.
- Export button Each tab in the Route Manager (except the Layer Tab) has a button “Export……”. Use this to export one Waypoint, one Route or one Track at a time. Multiple selection is possible in this version of OpenCPN (and several previous versions).
- To Create a layer, a collection of waypoints, routes and tracks by making the features to be included in the layer visible. Everything else should be deleted or hidden. Every object that is visible on the screen when maximum zoomed out, will be included, not just what is visible on the screen for the moment. When you are ready, use the “Export all visible” button to create the layer gpx file.
- To Change an existing Layer start with creating a backup of the existing gpx file, containing the layer, by copying it to a safe place. Make sure that no navigational objects are visible, that you don't want in the new version of the layer. Then use the Route Managers “Import GPX..” and load the layer to be edited. Perform your changes to the layer and press “Export All Visible…”, and save. If you made a backup, just overwrite the original file. Otherwise give the changed Layer a new name.
- Use your saved files by importing them back into OpenCPN. Press the “Import GPX” button in the Route Manager. Layers can be set up to load autmatically on starting OpenCPN. Read more in Layers