Reply
New Member
Posts: 26
Registered: ‎02-10-2018
Accepted Solution

Moving raw data to new linux instance

Hi all,

I have (had) a controller running on Ubuntu Amazon EC2 instance. The instance was on ubunti 16 and I attempted to update the instace to Ubuntu release 18 which broke my instance and my Controller installation. Attempted to fix but not much luck there.

I stupidly did not made a backup from the GUI of the controller, however I can still ssh into my old instance and grab raw data.

 

Since the only thing running on that instances was the Unifi controller, I thought the easiest solution now would be to create a new updated instance and then move the files over.

 

Is it possible to export the raw data and add them to a new instance? if yes, what directories am I exporting and any other tips?

Thanks in advance for any input!


Accepted Solutions
Established Member
Posts: 969
Registered: ‎02-12-2013
Kudos: 248
Solutions: 89

Re: Moving raw data to new linux instance

@zebrascanfly
Were you running 5.4.14 before? Normally it generates a version every time you upgrade. But yeah, you should be able to import "5.4.14.unf" into your new installation - just remember that all settings since 2018-09-10 will not be included.
Otherwise copy over everything and see if you can get the new controller to play nice with the old databases.

View solution in original post


All Replies
Established Member
Posts: 969
Registered: ‎02-12-2013
Kudos: 248
Solutions: 89

Re: Moving raw data to new linux instance

[ Edited ]

Hi @zebrascanfly

Normally on Ubuntu, all the Unifi data is located in /var/lib/unifi
And unless you've changed the configuration, then normally it would keep a settings-backup in /var/lib/unifi/backup and even in /var/lib/unifi/backup/autobackup

But if you copy /var/lib/unifi over to the new server, then it should work (unless something happened when everything broke) - remember to preserve user/group/permissions for everything.

I would probably try to make a clean install and just try to import the latest settings-backups, since then everything is clean.

New Member
Posts: 26
Registered: ‎02-10-2018

Re: Moving raw data to new linux instance

Thanks Flamber,

On my old/broken install I can see this:

ubuntu@127:/var/lib/unifi$ sudo ls -l backup/
total 1348
-rw-r--r-- 1 unifi unifi 513792 Apr 29  2017 4.8.18.unf
-rw-r--r-- 1 unifi unifi 854800 Sep 10 12:23 5.4.14.unf
drwx------ 2 unifi unifi   4096 Apr 29  2017 autobackup
-rw-r--r-- 1 unifi unifi    302 Sep 10 12:23 meta.json
ubuntu@127:/var/lib/unifi$ sudo ls -l backup/autobackup
total 0

The autobackup dir is empty, are the 4.8.18.unf and 5.4.14.unf backup files I should be able to import to my new install?

 

Established Member
Posts: 969
Registered: ‎02-12-2013
Kudos: 248
Solutions: 89

Re: Moving raw data to new linux instance

@zebrascanfly
Were you running 5.4.14 before? Normally it generates a version every time you upgrade. But yeah, you should be able to import "5.4.14.unf" into your new installation - just remember that all settings since 2018-09-10 will not be included.
Otherwise copy over everything and see if you can get the new controller to play nice with the old databases.
Senior Member
Posts: 16,445
Registered: ‎08-04-2017
Kudos: 3004
Solutions: 810

Re: Moving raw data to new linux instance

Hello @zebrascanfly,

 

Those are your only backups... I can give it a shot to repair your current broken install through TeamViewer ( send details in a PM ), otherwise the backups from September 10 is your latest ( 5.4.14 )

 


Regards,

Glenn R.

Cloud Hosted Controllers | Glenn R. | UniFi Installation/Easy Update Scripts | UniFi-VoIP Installation Scripts
USG-4-PRO • USG
USW-48-500W • USW-24-POE-250W 2x • USW-16-POE-150W 3x • USW-24 • USW-8-150W • USW-8
UAP XG • UAP-SHD • UAP-HD • UAP-NanoHD • UAP-AC-PRO 2x • UAP-AC-LITE • UAP-AC-IW • UAP-AC-M
UCK-G2-PLUS • UCK-G2 • UCK
New Member
Posts: 26
Registered: ‎02-10-2018

Re: Moving raw data to new linux instance

Thank you both. 

I was able to restore from the 5.4 backup. 

Nothing much changed and this solution worked for me.

1000 times same lesson, backup first before upgrades Man Happy

Highlighted
Senior Member
Posts: 16,445
Registered: ‎08-04-2017
Kudos: 3004
Solutions: 810

Re: Moving raw data to new linux instance

Hello @zebrascanfly,

 

Awesome, thanks for reporting back!

You may want to enable autobackups.

 

Happy new year!

 

 

Regards,

Glenn R.

Cloud Hosted Controllers | Glenn R. | UniFi Installation/Easy Update Scripts | UniFi-VoIP Installation Scripts
USG-4-PRO • USG
USW-48-500W • USW-24-POE-250W 2x • USW-16-POE-150W 3x • USW-24 • USW-8-150W • USW-8
UAP XG • UAP-SHD • UAP-HD • UAP-NanoHD • UAP-AC-PRO 2x • UAP-AC-LITE • UAP-AC-IW • UAP-AC-M
UCK-G2-PLUS • UCK-G2 • UCK
Reply