Skip to main content

Adding Solr config zip (ie. solr_8.x_config.zip) to your remote server.  In this instance I'll be adding Solr config to a AWS EC2 server.

 

Log in to your remote server, then as you need to work as root type:

sudo su

Go to your solr directory:

cd /var/solr/

If you don't know the location of your solr directory run:

find / -name solr -type d

You can find more information about how to search on Terminal Commands Find.

Access your solr config directory through:

cd data/{dir}/conf or /var/solr/data/{dir}/conf

In this instance, the {dir} is related to the directory where the site is located.  For example, the one I'm working on is staging /var/www/staging.  At this location I'm running Drupal 9.

Before you upload the solr config.zip, remove all of the files in this directory.

Location: /var/solr/data/staging/conf

rm -rf ./*

 

Options, there are several ways you can tackle the next step.  I will go through two options.

Option 1 : copy command

Upload the solr_8.x_config.zip to your server.  You will most likely upload it to your site directory (for me /var/www/staging).  Create a new temporary directory called solr-tmp.  Upload/transfer the solr_8.x_config.zip to this directory and unzip it.

Current directory: /var/www/staging/solr-tmp

unzip solr_8.x_config.zip

Now you can copy the files to the /var/solr/data/{dir}/conf directory, while you are within the solr-tmp directory

sudo cp ./* {destination_dir}

In this instance the destination_dir is /var/solr/data/staging/conf

sudo cp ./* /var/solr/data/staging/conf

Go across to your destination directory and check the files have been copied across.

cd /var/solr/data/staging/conf

Check by using the list command

ls -al

 

Option 2 : Unzip in destination directory

Upload the solr_8.x_config.zip to your server.  You will most likely upload it to your site directory (for me /var/www/staging).  Upload/transfer the solr_8.x_config.zip to this directory.  Move the zip file to the destination directory. 

Current directory: /var/www/staging

Destination directory: /var/solr/data/staging/conf

mv {file} {destination_dir}

File : solr_8.x_config.zip

mv "solr_8.x_config.zip"  /var/solr/data/staging/conf

Unzip the file

unzip solr_8.x_config.zip

Check by using the list command

ls -al

 

Whether you have used option one or two, when you run the list command the owner will be root.  The owner needs to be changed to solr.  Do this by running:

sudo chown solr:solr ./*

 

Reload Solr

You have uploaded the Solr config file.  Now you need to reload Solr.  You can do this inside Drupal.  Or easier, using the site IP address:

{ip_address:8983}

sample IP address: 12.345.67.890

12.345.67.890:8983

This action will load the Solr page.  Click on Core Admin, select your environment, then click Reload.

Check current has changed from a cross to a tick... meaning Solr is good to go.

Related articles

Andrew Fletcher04 Apr 2025
Managing .gitignore changes
When working with Git, the .gitignore file plays a critical role in controlling which files and folders are tracked by version control. Yet, many developers are unsure when changes to .gitignore take effect and how to manage files that are already being tracked. This uncertainty can lead to...
Andrew Fletcher26 Mar 2025
How to fix the ‘Undefined function t’ error in Drupal 10 or 11 code
Upgrading to Drupal 10.4+ you might have noticed a warning in their code editor stating “Undefined function ‘t’”. While Drupal’s `t()` function remains valid in procedural code, some language analysis tools — such as Intelephense — do not automatically recognise Drupal’s global functions. This...
Andrew Fletcher17 Mar 2025
Upgrading to PHP 8.4 challenges with Drupal contrib modules
The upgrade from PHP 8.3.14 to PHP 8.4.4 presents challenges for Drupal 10.4 websites, particularly when dealing with contributed modules. While Drupal core operates seamlessly, various contrib modules have not yet been updated to accommodate changes introduced in PHP 8.4.x. This has resulted in...