Oupgrade will swap user files?
- 
					
					
					
					
 It seems every time I oupgrade the firmware, the installed software and my files are swapped. Any method to avoid this? 
 
- 
					
					
					
					
 @Jun Cao As I understand it, when you do an oupgrade only files within the /etc directory are preserved, all else will get removed/replaced. It is also my understanding that this will be dealt with in a future release. However, I also note that the file /etc/sysupgrade.conf contains the following: 
 ## This file contains files and directories that should 
 ## be preserved during an upgrade.# /etc/example.conf 
 # /etc/openvpn
 I intend to experiment with this. 
 Would any of the Omega people care to comment?
 
- 
					
					
					
					
 Thanks for reply, @Kit-Bishop . I'll take an experiment for next upgrade, since I've already upgraded to the latest version. 
 
- 
					
					
					
					
 @Jun-Cao I can confirm that the trick with /etc/sysupgrade.conf works  
 I did the following:- Created two directories in /
- /testa
- /testb
 
- Changed /etc/sysupgrade.conf to have line:
- /testa/
 
- Ran oupgrade -force
 Note that the -force option forces an upgrade to occur even if it isn't needed
- Checked the directories after the upgrade:
- /testa still existed - it was named in /etc/sysupgrade.conf
- /testb no longer existed - it was not named in /etc/sysupgrade.conf
 
 
 
- Created two directories in /
- 
					
					
					
					
 I made a directory called /home. I put /home in etc/sysupgrade.conf but it still got erased on oupgrade -force. Does this only work inside of /etc or am i missing something? I checked with openwrt references and couldn't find a solution. 
 
- 
					
					
					
					
 @Chuck-Parro Not sure why you should be having a problem. I have two directories in my etc/sysupgrade.conf file and they are getting preserved over an upgrade. Are you sure you have entry for the directory, not just a file. 
 My understanding, though I haven't checked in detail is that a file you want to be preserved should be named without a trailing / character: e.g. /myfile and that a directory to be preserved should have a trailing / character: e.g. /mydir/
 That's what's working for me. Perhaps the Omega guys could confirm.
 
- 
					
					
					
					
 I have tried every variation i can think of to get it to work but no luck. Is it possible that something changed in the latest upgrade? 
 
- 
					
					
					
					
 @Chuck-Parro Sorry to hear you are having problems with this. It has all been working fine with me. 
 Could you post a copy of your /etc/sysupgrade.conf file from your Omega so I (or someone else) could have a look at it.
 
- 
					
					
					
					
 I found my error. When i used the built in editor to add the lines to sysupgrade.conf i didn't hit 'enter' after the last line to signify eol. I noticed it when i used cat to display the file as i got ready to post another message. Sorry to waste your time but thank you for helping. 
 
- 
					
					
					
					
 I was wrong. The dir only gets saved by sysupgrade.conf if it has something in it. If the dir i add is empty it doesn't get saved. When i put some dummy file into it it works. Does this make sense or is there something else i am missing. 
 
- 
					
					
					
					
 @Chuck-Parro Glad to hear you got something sorted.  Interesting to know about the issue with empty directories - I'll see what I get with that case. Interesting to know about the issue with empty directories - I'll see what I get with that case.
 
- 
					
					
					
					
 @Chuck-Parro I agree with you regarding empty directories not getting preserved. - Just created two directories under /
- One I left empty, one I put a file in
- Named both in /etc/sysupgrade.conf
- Did an oupgrade -force
- The directory with a file was preserved, the empty directory was removed
 @Boken-Lin I'd say this was a bug that probably should be fixed. Should I raise a ticket under https://github.com/OnionIoT/Onion-Console/issues ? 
 
- 
					
					
					
					
 Thanks Kit. 
 
- 
					
					
					
					
 @Kit-Bishop that's odd... not really a Console issue though, I'll look into it. 
 
- 
					
					
					
					
 @Kit-Bishop @Chuck-Parro 
 ok I've looked into the mechanism that preserves files noted in/etc/sysupgrade.conf, it looks for files in the directories specified.If you want to preserve a directory (i presume for mount points?), make a dummy file in it. The dummy file can be empty. 
 
- 
					
					
					
					
 @Lazar-Demin Yes, thanks - that pretty much matches my experience. 
 And you are right about wanting to preserve mount point directories.
 I name 2 directories in /etc/sysupgrade.conf that i want preserved:- My USB mount point
- My /root directory - that's where I put files I'm currently working on and testing and I don't want them wiped over an upgrade - though that obviously isn't an issue if /root is empty at the time of upgrade since it gets re-created on the upgrade
 
 
- 
					
					
					
					
 @Kit-Bishop yep, that's exactly my reasoning with the /root directory The next firmware release will have /etc/sysupgrade.confupdated to include/root
 coming very soon!!!
 
- 
					
					
					
					
 @Lazar-Demin Cool - thanks  
 
