Stage 6: Migrating Search Configurations

Now that your web server configurations are deployed to Liferay Cloud, the next stage of migration is to migrate your search configurations. This involves migrating your search engine to Elasticsearch (if needed), and deploying all of your Elasticsearch configuration files and plugins to your Liferay Cloud environments.

Migrate Your Search Engine to Elasticsearch

If you are not using Elasticsearch in your on-premises environment, then migrate to Elasticsearch before proceeding.

Migrating to Elasticsearch involves installing and then connecting your Liferay installation to it. See Getting Started with Elasticsearch for more information.

tip

If you need help with migrating to Elasticsearch, please contact Liferay Cloud Support.

Organize Configurations and Shell Scripts

note

Skip this step if you do not have any specific Elasticsearch configurations or scripts to organize.

In the project repository you cloned previously, navigate to the search/configs/[ENV]/ folders (which correspond to your Liferay Cloud environments), and put all of your Elasticsearch configuration files and shell scripts into the appropriate environment folders, following this pattern:

  • Put Elasticsearch configuration files into search/configs/[ENV]/config/
  • Put all custom shell scripts into search/configs/[ENV]/scripts/

All custom shell scripts in the appropriate folder run each time the search service is redeployed.

tip

To see what an Elasticsearch configuration file looks like, see the example configuration here.

Add Extra Search Plugins

note

Skip this step if you do not have any extra plugins to add.

First, review the list of plugins that are already installed on Liferay Cloud by default:

  1. In your Liferay Cloud environment, navigate to a production (prd) environment.

    Navigate to a production environment using the dropdown at the top of the console screen.

    Production environments contain all of the pre-installed Elasticsearch plugins.

  2. Navigate to the search service, and click on the Shell tab.

  3. In the shell, run this command:

    bin/elasticsearch-plugin list
    

The shell lists all pre-installed Elasticsearch plugins when you run the command.

If you have extra search plugins that are not listed, add them to your Liferay Cloud project’s repository:

  1. In your repository, open the search/LCP.json file.

  2. Add an environment variable named LCP_SERVICE_SEARCH_ES_PLUGINS with a comma-separated list of Search plugins you need to add to the pre-installed plugins.

    For example, to install the analysis-kuromoji plugin, add this environment variable:

    "env: {
        "LCP_SERVICE_SEARCH_ES_PLUGINS": "analysis-kuromoji"
    }
    

Create and Deploy a Build

Next, create and deploy a build with these changes to apply them to your Liferay Cloud environments.

Create a Jenkins Build with the Change

Run Git commands to submit your changes using any terminal with Git installed.

  1. Add the changed files to Git:

    git add .
    
  2. Make a commit with your changes and a message:

    git commit -m "Liferay Cloud Migration Stage 6"
    
  3. Push the changes to GitHub:

    git push origin master
    

Since your project is linked to the GitHub repository, pushing the changes automatically creates a build. Wait for the build to complete before proceeding.

Deploy the Build to Your Chosen Environment

Finally, use the Liferay Cloud Console to deploy the completed build to your chosen environment.

  1. In the Liferay Cloud Console, go to the Builds page (using the link at the top of the page).

  2. Find the build you created previously in the list, and from the Actions menu, click Deploy build to.

    Use the build's Actions menu to deploy it.

  3. Select the environment to deploy the build to (e.g., acme-dev).

  4. Read the information below and select the confirmation boxes to confirm the results of the deployment.

    Check the checkboxes and deploy the build when ready.

  5. Click Deploy Build.

The build is deployed to your chosen environment, and your Elasticsearch configurations, shell scripts, and plugins are applied to the chosen environment once the search service restarts.

Next Steps

Now you have finished migrating your Elasticsearch configurations to your Liferay Cloud environments. Next, you will configure and connect a VPN server.

Capabilities

Product

Contact Us

Connect

Powered by Liferay
© 2024 Liferay Inc. All Rights Reserved • Privacy Policy