# Migration from bundle package to snap

**URL:** https://forums.rocket.chat/t/migration-from-bundle-package-to-snap/2124
**Category:** Community Support
**Created:** [September 27, 2018, 10:48am UTC](https://forums.rocket.chat/t/migration-from-bundle-package-to-snap/2124 "2018-09-27T10:48:07Z")
**Posts on this page:** 15
**Page:** 1

<div class="post-metadata">

### Author: ![maciej](https://avatars.discourse-cdn.com/v4/letter/m/f9ae1b/32.png) [@maciej](https://forums.rocket.chat/u/maciej)
#### Post date: [September 27, 2018, 10:48am UTC](https://forums.rocket.chat/t/migration-from-bundle-package-to-snap/2124/1 "2018-09-27T10:48:07Z")

</div>

Hello,  
I’m using RocketChat from bundle package. I would like to migrate it to snap package, how can I do it without losing any data?

---

<div class="post-metadata">

### Author: ![localguru](https://sea1.discourse-cdn.com/flex021/user_avatar/forums.rocket.chat/localguru/32/12_2.png) [@localguru](https://forums.rocket.chat/u/localguru)
#### Post date: [September 27, 2018, 11:09am UTC](https://forums.rocket.chat/t/migration-from-bundle-package-to-snap/2124/2 "2018-09-27T11:09:59Z")

</div>

I’d like to know too.

---

<div class="post-metadata">

### Author: ![aaron.ogle](https://sea1.discourse-cdn.com/flex021/user_avatar/forums.rocket.chat/aaron.ogle/32/15_2.png) [@aaron.ogle](https://forums.rocket.chat/u/aaron.ogle)
#### Post date: [September 28, 2018, 4:01pm UTC](https://forums.rocket.chat/t/migration-from-bundle-package-to-snap/2124/3 "2018-09-28T16:01:44Z")

</div>

Typically people actually go the opposite direction and move out of snap because they out grow it.

If you have a small server snap is still of course a good choice.

Moving from bundle to snap would go something like this:

```auto
mongodump --db rocketchat -o dump
tar -zcvf backup.tar.gz dump

```

Of course sub rocketchat with the name you used for your database.

Move the backup.tar.gz to the server running the snap.

Then the snap restore steps listed here: [https://rocket.chat/docs/installation/manual-installation/ubuntu/snaps/#how-do-i-restore-backup-data-to-my-snap](https://rocket.chat/docs/installation/manual-installation/ubuntu/snaps/#how-do-i-restore-backup-data-to-my-snap)

🙂

---

<div class="post-metadata">

### Author: ![Julianoe](https://sea1.discourse-cdn.com/flex021/user_avatar/forums.rocket.chat/julianoe/32/811_2.png) [@Julianoe](https://forums.rocket.chat/u/Julianoe)
#### Post date: [January 12, 2019, 4:10pm UTC](https://forums.rocket.chat/t/migration-from-bundle-package-to-snap/2124/4 "2019-01-12T16:10:43Z")

</div>

That’s exactly what i tried to do and it did not work. My backup is 500Mo is it because it’s too big? I get an error while the script succeeds to export the tarball… what’s wrong?

```auto
[*] Extracting backup file...
ERROR: ld.so: object '/usr/lib/arm-linux-gnueabihf/libarmmem.so' from /etc/ld.so.preload cannot be preloaded (cannot open shared object file): ignored.
[*] Restoring data...
ERROR: ld.so: object '/usr/lib/arm-linux-gnueabihf/libarmmem.so' from /etc/ld.so.preload cannot be preloaded (cannot open shared object file): ignored.
ERROR: ld.so: object '/usr/lib/arm-linux-gnueabihf/libarmmem.so' from /etc/ld.so.preload cannot be preloaded (cannot open shared object file): ignored.
ERROR: ld.so: object '/usr/lib/arm-linux-gnueabihf/libarmmem.so' from /etc/ld.so.preload cannot be preloaded (cannot open shared object file): ignored.
[!] Restore data not found within /var/snap/rocketchat-server/common/rocketchat_dump_2019_01_11.tar.gz!
    Please check that your backup file contains the backup data within the "parties" directory.
[*] Check /var/snap/rocketchat-server/common/restore/extraction.log for details.
[-] Restore aborted!

```

---

<div class="post-metadata">

### Author: ![sing.li](https://sea1.discourse-cdn.com/flex021/user_avatar/forums.rocket.chat/sing.li/32/6_2.png) [@sing.li](https://forums.rocket.chat/u/sing.li)
#### Post date: [January 12, 2019, 4:49pm UTC](https://forums.rocket.chat/t/migration-from-bundle-package-to-snap/2124/5 "2019-01-12T16:49:27Z")

</div>

True. Snap is hard coded to expect the database (directory) to be named `parties`😶

---

<div class="post-metadata">

### Author: ![Julianoe](https://sea1.discourse-cdn.com/flex021/user_avatar/forums.rocket.chat/julianoe/32/811_2.png) [@Julianoe](https://forums.rocket.chat/u/Julianoe)
#### Post date: [January 12, 2019, 4:51pm UTC](https://forums.rocket.chat/t/migration-from-bundle-package-to-snap/2124/6 "2019-01-12T16:51:31Z")

</div>

That’s it ? Oh. ok. My bad then. Gonna try it again just now.

---

<div class="post-metadata">

### Author: ![Julianoe](https://sea1.discourse-cdn.com/flex021/user_avatar/forums.rocket.chat/julianoe/32/811_2.png) [@Julianoe](https://forums.rocket.chat/u/Julianoe)
#### Post date: [January 12, 2019, 5:07pm UTC](https://forums.rocket.chat/t/migration-from-bundle-package-to-snap/2124/7 "2019-01-12T17:07:54Z")

</div>

@sing.li  
So i tried it. Indeed it caused that simple error.

When i import i have an error in mongorestore.log though ☹

```auto
ERROR: ld.so: object '/usr/lib/arm-linux-gnueabihf/libarmmem.so' from /etc/ld.so.preload cannot be preloaded (cannot open shared object file): ignored.
connected to: 127.0.0.1
2019-01-12T18:02:26.765+0100 var/snap/rocketchat-server/1278/dump/parties/rocketchat_livechat_visitor.bson
2019-01-12T18:02:26.765+0100 going into namespace [parties.rocketchat_livechat_visitor]
2019-01-12T18:02:26.765+0100 dropping
assertion: 15936 Creating collection parties.rocketchat_livechat_visitor failed. Errmsg: exception: can't map file memory - mongo requires 64 bit build for larger datasets

```

---

<div class="post-metadata">

### Author: ![sing.li](https://sea1.discourse-cdn.com/flex021/user_avatar/forums.rocket.chat/sing.li/32/6_2.png) [@sing.li](https://forums.rocket.chat/u/sing.li)
#### Post date: [January 12, 2019, 5:24pm UTC](https://forums.rocket.chat/t/migration-from-bundle-package-to-snap/2124/8 "2019-01-12T17:24:03Z")

</div>

hmmm… seems you’re running 32 bit mongo server … the limit is 2GB on 32 bit mongo. Your DB size is 500MB uncompressed, right?

---

<div class="post-metadata">

### Author: ![Julianoe](https://sea1.discourse-cdn.com/flex021/user_avatar/forums.rocket.chat/julianoe/32/811_2.png) [@Julianoe](https://forums.rocket.chat/u/Julianoe)
#### Post date: [January 13, 2019, 7:30pm UTC](https://forums.rocket.chat/t/migration-from-bundle-package-to-snap/2124/9 "2019-01-13T19:30:27Z")

</div>

Uncompressed my database is 597 MB

I tried to redo the whole snap install after updating everything and starting from a clean slate.  
Now it seems the import goes well until one database file: (see the log file here [https://pastebin.com/x8c6Vzm4](https://pastebin.com/x8c6Vzm4))

The error at the last line is the following

```auto
assertion: 15936 Creating collection parties.rocketchat_raw_imports failed. Errmsg: exception: can't map file memory - mongo requires 64 bit build for larger datasets

```

Still the same actually but not happening at the start this time… weird. The raw imports is a tiny document actually. And it seems there is no error when mongo tries to import the 522MB chunks.json file

---

<div class="post-metadata">

### Author: ![sing.li](https://sea1.discourse-cdn.com/flex021/user_avatar/forums.rocket.chat/sing.li/32/6_2.png) [@sing.li](https://forums.rocket.chat/u/sing.li)
#### Post date: [January 14, 2019, 3:57am UTC](https://forums.rocket.chat/t/migration-from-bundle-package-to-snap/2124/10 "2019-01-14T03:57:08Z")

</div>

> [@Julianoe](#):
>
> assertion: 15936 Creating collection parties.rocketchat\_raw\_imports failed. Errmsg: exception: can’t map file memory

Here is a historical note from official Mongo FWIW

[https://jira.mongodb.org/browse/SERVER-1811](https://jira.mongodb.org/browse/SERVER-1811)

1. ARMHF is not officially supported
2. Even for supported arm64 platforms, only WiredTiger engine is supported - they seem to have problem getting the mmapv1 engine to work with full spec.

---

<div class="post-metadata">

### Author: ![Julianoe](https://sea1.discourse-cdn.com/flex021/user_avatar/forums.rocket.chat/julianoe/32/811_2.png) [@Julianoe](https://forums.rocket.chat/u/Julianoe)
#### Post date: [January 14, 2019, 4:00am UTC](https://forums.rocket.chat/t/migration-from-bundle-package-to-snap/2124/11 "2019-01-14T04:00:44Z")

</div>

I don’t understand… The snap install works because i managed to install it. So why is it impossible to restore a backup? Does this mean the provided path to install RC on Raspberries can’t allow database restore nor migration? I’m confused. How can it work and not work at the same time…

---

<div class="post-metadata">

### Author: ![Julianoe](https://sea1.discourse-cdn.com/flex021/user_avatar/forums.rocket.chat/julianoe/32/811_2.png) [@Julianoe](https://forums.rocket.chat/u/Julianoe)
#### Post date: [January 15, 2019, 2:04am UTC](https://forums.rocket.chat/t/migration-from-bundle-package-to-snap/2124/12 "2019-01-15T02:04:31Z")

</div>

Hi again!

I’ve experimented some things for quite a few hours.  
I’ve had success in importing a database (without the dispensable uploads file) thus making the total gzipped database a size of 18Mo. When importing no errors this time ! 😄🥳

The thing is the **three services are active** but the URL returns a 502 error.

I think the Caddy log is the relevant one

```auto
-- Logs begin at Thu 2016-11-03 18:16:42 CET, end at Tue 2019-01-15 03:00:41 CET. --
Started Service for snap application rocketchat-server.rocketchat-caddy.
cmd.go:105: DEBUG: restarting into "/snap/core/current/usr/bin/snap"
ERROR: ld.so: object '/usr/lib/arm-linux-gnueabihf/libarmmem.so' from /etc/ld.so.preload cannot be preloaded (cannot open shared object file): ignored.
ERROR: ld.so: object '/usr/lib/arm-linux-gnueabihf/libarmmem.so' from /etc/ld.so.preload cannot be preloaded (cannot open shared object file): ignored.
Activating privacy features... done.
https://url
http://url
WARNING: File descriptor limit 1024 is too low for production servers. At least 8192 is recommended. Fix with "ulimit -n 8192".

```

Here is the one from rocketchat.service

```auto
Started Service for snap application rocketchat-server.rocketchat-server.
cmd.go:105: DEBUG: restarting into "/snap/core/current/usr/bin/snap"
ERROR: ld.so: object '/usr/lib/arm-linux-gnueabihf/libarmmem.so' from /etc/ld.so.preload cannot be preloaded (cannot open shared object file): ignored.
ERROR: ld.so: object '/usr/lib/arm-linux-gnueabihf/libarmmem.so' from /etc/ld.so.preload cannot be preloaded (cannot open shared object file): ignored.
ERROR: ld.so: object '/usr/lib/arm-linux-gnueabihf/libarmmem.so' from /etc/ld.so.preload cannot be preloaded (cannot open shared object file): ignored.
ERROR: ld.so: object '/usr/lib/arm-linux-gnueabihf/libarmmem.so' from /etc/ld.so.preload cannot be preloaded (cannot open shared object file): ignored.
Mongo is not available, can't start. Waiting 10 seconds and trying again
ERROR: ld.so: object '/usr/lib/arm-linux-gnueabihf/libarmmem.so' from /etc/ld.so.preload cannot be preloaded (cannot open shared object file): ignored.
ERROR: ld.so: object '/usr/lib/arm-linux-gnueabihf/libarmmem.so' from /etc/ld.so.preload cannot be preloaded (cannot open shared object file): ignored.
ERROR: ld.so: object '/usr/lib/arm-linux-gnueabihf/libarmmem.so' from /etc/ld.so.preload cannot be preloaded (cannot open shared object file): ignored.
Checking if oplog has been enabled, and enabling if not
ERROR: ld.so: object '/usr/lib/arm-linux-gnueabihf/libarmmem.so' from /etc/ld.so.preload cannot be preloaded (cannot open shared object file): ignored.
MongoDB shell version: 2.6.10
connecting to: test
ERROR: ld.so: object '/usr/lib/arm-linux-gnueabihf/libarmmem.so' from /etc/ld.so.preload cannot be preloaded (cannot open shared object file): ignored.
Will load cache for users
31 records load from users
Will load cache for rocketchat_room
100 records load from rocketchat_room
Will load cache for rocketchat_subscription
412 records load from rocketchat_subscription
Will load cache for rocketchat_settings
786 records load from rocketchat_settings
Updating process.env.MAIL_URL
Starting Email Intercepter...
Will load cache for rocketchat_permissions
87 records load from rocketchat_permissions
Will load cache for rocketchat_roles
11 records load from rocketchat_roles
LocalStore: store created at
LocalStore: store created at
LocalStore: store created at
Warning: connect.session() MemoryStore is not
designed for a production environment, as it will leak
memory, and will not scale past a single process.
Setting default file store to GridFS
LocalStore: store created at
LocalStore: store created at
LocalStore: store created at
Tue, 15 Jan 2019 01:59:36 GMT connect deprecated multipart: use parser (multiparty, busboy, formidable) npm module instead at npm/node_modules/connect/lib/middleware/bodyParser.js:56:20
Tue, 15 Jan 2019 01:59:36 GMT connect deprecated limit: Restrict request size at location of read at npm/node_modules/connect/lib/middleware/multipart.js:86:15
Exception in callback of async function: Error: [Can't find migration version 137]
    at Object.Migrations._findIndexByVersion (/snap/rocketchat-server/1278/programs/server/packages/rocketchat_migrations.js:435:9)
    at Object.Migrations._migrateTo (/snap/rocketchat-server/1278/programs/server/packages/rocketchat_migrations.js:300:25)
    at Object.Migrations.migrateTo (/snap/rocketchat-server/1278/programs/server/packages/rocketchat_migrations.js:227:23)
    at xrun.js (/snap/rocketchat-server/1278/programs/server/app/app.js:7213:25)
    at fileEvaluate (packages/modules-runtime.js:343:9)
    at require (packages/modules-runtime.js:238:16)
    at /snap/rocketchat-server/1278/programs/server/app/app.js:12922:1
    at /snap/rocketchat-server/1278/programs/server/boot.js:411:36
    at Array.forEach (<anonymous>:null:null)
    at /snap/rocketchat-server/1278/programs/server/boot.js:220:19
    at /snap/rocketchat-server/1278/programs/server/boot.js:471:5
    at Function.run (/snap/rocketchat-server/1278/programs/server/profile.js:510:12)
    at /snap/rocketchat-server/1278/programs/server/boot.js:470:11

```

and the one from mongo.service

```auto
cmd.go:105: DEBUG: restarting into "/snap/core/current/usr/bin/snap"
ERROR: ld.so: object '/usr/lib/arm-linux-gnueabihf/libarmmem.so' from /etc/ld.so.preload cannot be preloaded (cannot open shared object file): ignored.
ERROR: ld.so: object '/usr/lib/arm-linux-gnueabihf/libarmmem.so' from /etc/ld.so.preload cannot be preloaded (cannot open shared object file): ignored.
ERROR: ld.so: object '/usr/lib/arm-linux-gnueabihf/libarmmem.so' from /etc/ld.so.preload cannot be preloaded (cannot open shared object file): ignored.
ERROR: ld.so: object '/usr/lib/arm-linux-gnueabihf/libarmmem.so' from /etc/ld.so.preload cannot be preloaded (cannot open shared object file): ignored.
2019-01-15T02:58:24.146+0100 [initandlisten] MongoDB starting : pid=781 port=27017 dbpath=/var/snap/rocketchat-server/common 32-bit host=raspberrypi
2019-01-15T02:58:24.155+0100 [initandlisten]
2019-01-15T02:58:24.155+0100 [initandlisten] ** NOTE: This is a 32 bit MongoDB binary.
2019-01-15T02:58:24.155+0100 [initandlisten] ** 32 bit builds are limited to less than 2GB of data (or less with --journal).
2019-01-15T02:58:24.155+0100 [initandlisten] ** See http://dochub.mongodb.org/core/32bit
2019-01-15T02:58:24.156+0100 [initandlisten]
2019-01-15T02:58:24.156+0100 [initandlisten] db version v2.6.10
2019-01-15T02:58:24.156+0100 [initandlisten] git version: nogitversion
2019-01-15T02:58:24.156+0100 [initandlisten] OpenSSL version: OpenSSL 1.0.2g 1 Mar 2016
2019-01-15T02:58:24.156+0100 [initandlisten] build info: Linux kishi10 3.2.0-84-highbank #121-Ubuntu SMP PREEMPT Tue May 5 19:44:15 UTC 2015 armv7l BOOST_LIB_VERSION=1_58
2019-01-15T02:58:24.156+0100 [initandlisten] allocator: tcmalloc
2019-01-15T02:58:24.156+0100 [initandlisten] options: { net: { bindIp: "127.0.0.1" }, processManagement: { pidFilePath: "/var/snap/rocketchat-server/common/mongod.pid" }, replication: { replSet: "rs0" }, storage: { dbPath: "/var/snap/rocketchat-server/common", journal: { enabled: true }, smallFiles: true } }
2019-01-15T02:58:24.190+0100 [initandlisten] journal dir=/var/snap/rocketchat-server/common/journal
2019-01-15T02:58:24.195+0100 [initandlisten] recover : no journal files present, no recovery needed
2019-01-15T02:58:25.999+0100 [initandlisten] waiting for connections on port 27017
2019-01-15T02:58:27.107+0100 [rsStart] query local.system.replset planSummary: COLLSCAN ntoreturn:1 ntoskip:0 nscanned:1 nscannedObjects:1 keyUpdates:0 numYields:1 locks(micros) r:123239 nreturned:1 reslen:108 1106ms
2019-01-15T02:58:27.109+0100 [rsStart] replSet I am localhost:27017
2019-01-15T02:58:27.126+0100 [rsStart] replSet STARTUP2
2019-01-15T02:58:27.127+0100 [rsSync] replSet SECONDARY
2019-01-15T02:58:27.127+0100 [rsMgr] replSet info electSelf 0
2019-01-15T02:58:27.127+0100 [rsMgr] replSet PRIMARY
2019-01-15T02:58:32.430+0100 [initandlisten] connection accepted from 127.0.0.1:37008 #1 (1 connection now open)
2019-01-15T02:58:32.457+0100 [conn1] end connection 127.0.0.1:37008 (0 connections now open)
2019-01-15T02:58:39.807+0100 [initandlisten] connection accepted from 127.0.0.1:37010 #2 (1 connection now open)
2019-01-15T02:58:39.869+0100 [initandlisten] connection accepted from 127.0.0.1:37012 #3 (2 connections now open)
2019-01-15T02:58:39.878+0100 [initandlisten] connection accepted from 127.0.0.1:37014 #4 (3 connections now open)
2019-01-15T02:58:52.068+0100 [conn3] getmore local.oplog.rs cursorid:529075794089 ntoreturn:1000 keyUpdates:0 numYields:0 locks(micros) r:367 nreturned:0 reslen:20 12117ms
2019-01-15T02:58:56.866+0100 [initandlisten] connection accepted from 127.0.0.1:37016 #5 (4 connections now open)
2019-01-15T02:59:07.180+0100 [initandlisten] connection accepted from 127.0.0.1:37018 #6 (5 connections now open)
2019-01-15T02:59:14.368+0100 [initandlisten] connection accepted from 127.0.0.1:37036 #7 (6 connections now open)
2019-01-15T02:59:33.262+0100 [clientcursormon] mem (MB) res:36 virt:954
2019-01-15T02:59:33.263+0100 [clientcursormon] mapped (incl journal view):704
2019-01-15T02:59:33.263+0100 [clientcursormon] connections:6
2019-01-15T02:59:33.263+0100 [clientcursormon] replication threads:4
2019-01-15T03:04:33.393+0100 [clientcursormon] mem (MB) res:36 virt:958
2019-01-15T03:04:33.393+0100 [clientcursormon] mapped (incl journal view):704
2019-01-15T03:04:33.393+0100 [clientcursormon] connections:6
2019-01-15T03:04:33.393+0100 [clientcursormon] replication threads:4

```

---

<div class="post-metadata">

### Author: ![lucia.guevgeozian](https://sea1.discourse-cdn.com/flex021/user_avatar/forums.rocket.chat/lucia.guevgeozian/32/447_2.png) [@lucia.guevgeozian](https://forums.rocket.chat/u/lucia.guevgeozian)
#### Post date: [February 1, 2019, 2:50am UTC](https://forums.rocket.chat/t/migration-from-bundle-package-to-snap/2124/13 "2019-02-01T02:50:22Z")

</div>

> [@Julianoe](#):
>
> Error: [Can’t find migration version 137]

Looks like rocket.chat didn’t come up, probably due to different versions between your current snap install and the one you had before?

---

<div class="post-metadata">

### Author: ![Julianoe](https://sea1.discourse-cdn.com/flex021/user_avatar/forums.rocket.chat/julianoe/32/811_2.png) [@Julianoe](https://forums.rocket.chat/u/Julianoe)
#### Post date: [February 24, 2019, 12:59pm UTC](https://forums.rocket.chat/t/migration-from-bundle-package-to-snap/2124/14 "2019-02-24T12:59:19Z")

</div>

It was indeed the case. My RocketChat installation was at the last version. Snap install is not fully up to date.  
Does that mean i will only be able to migrate when the snap install is up to date?

---

<div class="post-metadata">

### Author: ![krak](https://sea1.discourse-cdn.com/flex021/user_avatar/forums.rocket.chat/krak/32/1836_2.png) [@krak](https://forums.rocket.chat/u/krak)
#### Post date: [June 12, 2020, 10:47pm UTC](https://forums.rocket.chat/t/migration-from-bundle-package-to-snap/2124/15 "2020-06-12T22:47:11Z")

</div>

Hello. I have installed version of Rocket Chat 3.1.1 by this instruction [https://docs.rocket.chat/installation/manual-installation/ubuntu](https://docs.rocket.chat/installation/manual-installation/ubuntu)  
I want to migrate to snap version for simple upgrade rocket chat. Sorry, my knowledge for node and mongo is very poor. I create dump by executing from post @aaron.ogle and try to restore backup by this instruction [https://rocket.chat/docs/installation/manual-installation/ubuntu/snaps/#how-do-i-restore-backup-data-to-my-snap](https://rocket.chat/docs/installation/manual-installation/ubuntu/snaps/#how-do-i-restore-backup-data-to-my-snap), but I have error when restore backup

snap run rocketchat-server.restoredb /var/snap/rocketchat-server/common/backup.tar.gz  
\*\*\* ATTENTION \*\*\*

- Your current database WILL BE DROPPED prior to the restore!
- Do you want to continue?

1. Yes
2. No  
#? 1  
[_] Extracting backup file…  
ls: cannot access ‘/var/snap/rocketchat-server/common/restore/dump/parties’: No such file or directory  
[!] No restore data found within /var/snap/rocketchat-server/common/restore/dump/parties!  
[_] Check /var/snap/rocketchat-server/common/restore/restore\_20200613.0036.log for details.  
 Restore aborted!
