Installation Guide

Please follow these steps to get MemberJunction installed!

Prerequisites

  • SQL Server Database created – can be Azure SQL Server or regular SQL Server. Note: Azure SQL is currently recommended to avoid additional steps required to establish trust between a regular SQL connection and the server certificate.
  • On the computer you are installing MemberJunction:
    • NodeJS 20+
  • Local working directory. Create a directory on your computer that will be used for MemberJunction work. We highly recommend that this repository is a clone of a remote git repository in your favorite git tool such as GitHub, Bitbucket, etc.

📘

The process of installation attempts to run CodeGen to generate local code for your database. If you are starting with an empty database then this won’t result in new Entities or other artifacts being created in the metadata or code being generated. If you follow the above process and then separately get your data into the database, you can manually run CodeGen again at any time.

Steps

  • Select the version you want to download from this page
  • Download and unzip the file on your local computer into the working directory noted above in Prerequisites, where you want to work on MemberJunction

2. SQL Server Setup

  • Make sure you have your SQL Server and Database setup and ready to go
  • That database can have existing tables in it, just make sure there is no existing schema named “__mj ” as MemberJunction installs its tables, by default, into a schema called “__mj”. If you do have a schema named “__mj”, you will need to modify the table installation script and set configuration variables differently in the CodeGen and MJAPI projects to make MemberJunction work off a different schema.
  • Create the following logins within the master database of the SQL server. The syntax should be in the form CREATE LOGIN <login_name> WITH PASSWORD = ‘’:
    • MJ_Connect
    • MJ_Connect_Dev
    • MJ_CodeGen
    • MJ_CodeGen_Dev

3. Run SQL Migration

  • A configuration file must be present to run migrations. The configuration file can be provided as a .mjrc.yml file containing the following values adjusted for your installation
dbDatabase: MJ_DATABASE
dbHost: localhost
codeGenLogin: privileged_login
codeGenPassword: 'VeryStr0ngP@ssw0rd'
dbTrustServerCertificate: Y
cleanDisabled: false
  • With the configuration file in place, run the migration tool using the MJ CLI
npx @memberjunction/cli migrate
  • The migration tool will setup a new MJ database, or update any existing v2.0+ database, but will not migrate any pre-2.0 database. It is recommended to reinstall MJ for v2.0 whenever possible as each installation's migration path may be unique.

📘

Run MJAPI before you run MJExplorer, the local API server is needed for MJExplorer (and any other API client) to run.

4. Run the MemberJunction Installer script

  • Run the MemberJunction Installer script with the following command in a terminal window from the root of where you unzipped the download file:
    • npx @memberjunction/cli install
    • The installer script will ask you a series of questions. Instead of answering these questions in the console, you can opt to fill in the install.config.json file that will be part of the zip file. If you intend to run the MJ Installer more than once you can save this install.config.json file and reuse it, saving a lot of time compared to manually answering the questions in the installer script each time.

📘

MJExplorer is a useful application to test on your installation of MemberJunction. Even if you don’t plan to use MJ Explorer for your environment, running it successfully and by browsing some of your data helps you validate that your installation proceeded correctly.

5. At this point, you can run MemberJunction API and Explorer to test your install:

  • From the MJAPI directory, run the project either in a debugger environment like VSCode, or just run it with a node command line
  • In a new console window, from the MJExplorer directory, after MJAPI is up and running, run MJExplorer. Either run it in debug mode in VSCode, or run ng serve from the command line in the directory.

👍

After you complete the above steps you should have a functioning installation of MemberJunction on your local computer.