Migrate a NodeBB with MongoDB to Discourse in docker

Hello everyone!

It seems like there has been no update on the topic since that tutorial.
But as far as I understand, I can’t use MongoDB inside the Docker container.
Can I connect to Mongo remotely?
Is there any yaml template for such migration, the same way is done for Vanilla?

The nodebb.rb script has this:
# adapter = NodeBB::Mongo # @client = adapter.new('mongodb://127.0.0.1:27017/nodebb')
So you’d uncomment those and put the appropriate URL to connect to your mongo there and comment out the redis connection stuff. You probably need to add gem mongo to your Gemfile and bundle install.

I doubt it. I imagine that whoever wrote the script ran it in a development environment. You can endeavor to enter the container and add whatever stuff is needed to run it there.

1 Like

Could you please, explain every parameter in DB connection string?
For example, 127.0.0.1:27017 is domain(IP):port pair.
Next mongodb is that protocol or a database name?

Make some clarifications on topic.

I cannot, but I clicked the “ask AI” button and here’s what it said:

Certainly! A database connection string is a parameterized string used to establish a connection to a database. The specific parameters can vary depending on the type of database (such as MySQL, PostgreSQL, SQL Server, etc.) you are connecting to. Below, I’ll explain some of the common parameters found in a database connection string:

  1. Server/Host: The hostname or IP address of the server where the database is hosted. It specifies where the database can be found.

  2. Database: The name of the database to which the connection is being established. It tells the system which specific database on the server to connect to.

  3. User ID/Username: The username used to authenticate with the database. This parameter is part of the security measures to ensure that only authorized users can access the database.

  4. Password: The password associated with the username for authentication purposes. Like the username, this is a critical security feature.

  5. Port: The port number on which the database server is listening for connections. This is necessary if the database server is not using the default port number for the database type.

  6. SSLmode: This parameter dictates whether SSL (Secure Sockets Layer) is used for the connection. It can enhance the security of data transmitted between the database client and server.

  7. Timeout: Specifies the amount of time (usually in seconds) that the client will wait for a connection to be established before timing out.

  8. Charset/Collation: These parameters define the character set and collation for the connection, affecting how text is sorted and compared.

  9. Integrated Security/Trusted_Connection: Used primarily in connections to Microsoft SQL Server, this parameter specifies whether the connection will use the Windows account credentials of the current user for authentication, rather than specifying a username and password in the connection string.

Remember, the specific parameters you’ll need to use and their names can vary depending on the database system and the programming environment you’re working in. Always refer to the documentation for your specific database system and database driver/library for the most accurate information.

3 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.