Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate rocketchat to another server (with upgrade) #5007

Closed
oyeaussie opened this issue Nov 22, 2016 · 2 comments
Closed

Migrate rocketchat to another server (with upgrade) #5007

oyeaussie opened this issue Nov 22, 2016 · 2 comments

Comments

@oyeaussie
Copy link

Your Rocket.Chat version: 0.46.0

Hello,

I am trying to move my installation from a centos 6 server to centos 7 server. On the centos 6 server, I was running v0.34.0 and on the new centos 7 server we are running v 0.46.0. Steps I have taken so far:

  1. Upgraded the current centos 6 v0.34.0 -> 0.46.0
  2. Upgrade went fine, logs are as follows:

-bash-4.1# npm install
npm WARN package.json [email protected] No description
npm WARN package.json [email protected] No repository field.
npm WARN package.json [email protected] No README data
npm WARN package.json [email protected] No license field.

[email protected] install /opt/Rocket.Chat/programs/server/node_modules/fibers
node build.js || nodejs build.js

linux-x64-46 exists; testing
Binary is fine; exiting
npm WARN cannot run in wd [email protected] node npm-rebuild.js (wd=/opt/Rocket.Chat/programs/server)
[email protected] node_modules/amdefine

[email protected] node_modules/underscore

[email protected] node_modules/asap

[email protected] node_modules/meteor-promise

[email protected] node_modules/semver

[email protected] node_modules/source-map-support

[email protected] node_modules/source-map

[email protected] node_modules/eachline
└── [email protected]

[email protected] node_modules/promise

[email protected] node_modules/chalk
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected] ([email protected])
└── [email protected] ([email protected])

[email protected] node_modules/fibers
-bash-4.1# cd ../..
-bash-4.1# node main.js
Updating process.env.MAIL_URL
ufs: permissions are not defined for store "fileSystem"
ufs: store created at
ufs: permissions are not defined for store "fileSystem"
ufs: store created at
{"line":"159","file":"rocketchat_migrations.js","message":"Migrations: Migrating from version 54 -> 64","time":{"$date":1479798939679},"level":"info"}
{"line":"159","file":"rocketchat_migrations.js","message":"Migrations: Running up() on version 55","time":{"$date":1479798939687},"level":"info"}
{"line":"159","file":"rocketchat_migrations.js","message":"Migrations: Running up() on version 56","time":{"$date":1479798939727},"level":"info"}
{"line":"159","file":"rocketchat_migrations.js","message":"Migrations: Running up() on version 57","time":{"$date":1479798939770},"level":"info"}
{"line":"159","file":"rocketchat_migrations.js","message":"Migrations: Running up() on version 58","time":{"$date":1479798939841},"level":"info"}
{"line":"159","file":"rocketchat_migrations.js","message":"Migrations: Running up() on version 59","time":{"$date":1479798939904},"level":"info"}
{"line":"159","file":"rocketchat_migrations.js","message":"Migrations: Running up() on version 60","time":{"$date":1479798944732},"level":"info"}
{"line":"159","file":"rocketchat_migrations.js","message":"Migrations: Running up() on version 61","time":{"$date":1479798945016},"level":"info"}
{"line":"159","file":"rocketchat_migrations.js","message":"Migrations: Running up() on version 62","time":{"$date":1479798945027},"level":"info"}
{"line":"159","file":"rocketchat_migrations.js","message":"Migrations: Running up() on version 63","time":{"$date":1479798945163},"level":"info"}
{"line":"159","file":"rocketchat_migrations.js","message":"Migrations: Running up() on version 64","time":{"$date":1479798945428},"level":"info"}
{"line":"159","file":"rocketchat_migrations.js","message":"Migrations: Finished migrating.","time":{"$date":1479798945453},"level":"info"}
Not migrating, control is locked. Attempt 1/30. Trying again in 10 seconds.
{"line":"159","file":"rocketchat_migrations.js","message":"Migrations: Not migrating, already at version 64","time":{"$date":1479798955471},"level":"info"}
Updating process.env.MAIL_URL
Using GridFS for custom emoji storage
[Tue Nov 22 2016 18:15:58 GMT+1100 (EST)] WARNING A script has tried registering a HTTP route while the HTTP server is disabled with --disabled-httpd.
Loaded hubot-help/src/help.coffee
Loaded hello.coffee
Loaded zen.coffee
ufs: permissions are not defined for store "rocketchat_uploads"
Using GridFS for Avatar storage
➔ System ➔ startup
➔ +--------------------------------------------------+
➔ | SERVER RUNNING |
➔ +--------------------------------------------------+
➔ | |
➔ | Version: 0.46.0 |
➔ | Process Port: 3000 |
➔ | Site URL: http://chat......com.au:3000/ |
➔ | OpLog: Disabled |
➔ | |
➔ +--------------------------------------------------+
^C
-bash-4.1#

  • After the upgrade and making sure the new version works with the current database, I exported the db using mongodump and imported that db into the new server using mongorestore

Issues:

  1. File uploads that were uploaded on the old server are not accessible on the new server. Like images would have placeholder, but if you click on them you just get the loading spinner and no image.
  2. I am running rocketchat on the old server now till the above issue is resolved. As the old server is running centos 6, I get the following when I try to start the rocket chat service:

There is an issue with node-fibers

/opt/Rocket.Chat/programs/server/node_modules/fibers/bin/linux-x64-11/fibers.node is missing.

Try running this to fix the issue: /usr/bin/node /opt/Rocket.Chat/programs/server/node_modules/fibers/build

/opt/Rocket.Chat/programs/server/node_modules/fibers/fibers.js:20
throw new Error('Missing binary. See message above.');
^
Error: Missing binary. See message above.
at Object. (/opt/Rocket.Chat/programs/server/node_modules/fibers/fibers.js:20:8)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object. (/opt/Rocket.Chat/programs/server/boot.js:1:75)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
error: Forever detected script exited with code: 8
error: Script restart attempt #171

  • Server runs using node main.js command.

Appreciate if someone can provide any help with this migration.

Thanks.

@tntobias
Copy link

This is a lot to go through but I'd recommend a few things:

  1. If your Rocket.Chat uploads are on the file system, make sure the directory specified in the database exists and the service account has permissions to it. The logs above appear to indicate an issue accessing
  2. It looks like you're running npm install with elevated permissions. If you must do this, use the --unsafe-perm switch to make sure it
  3. If you've been tinkering with it for awhile, try cleaning the npm cache to make sure there's no leftover garbage.
  4. You say you're able to run the server using the node main.js command but you get errors launching the forever service? I'd think there's probably permissions issues there as well

Unfortunately I'm not as versed in modern CentOS as I am in Debian variants but maybe someone can chime in on whether there were significant changes to security in CentOS 7.

@oyeaussie
Copy link
Author

The primary issue got fixed. it was DNS issue. The dns needed to be pointed to the new server.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants