Skip to content

Commit 42d41eb

Browse files
mkalkbrennerstasadev
authored andcommitted
prepared migration script
1 parent 94a7aeb commit 42d41eb

23 files changed

+34
-19870
lines changed

README.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,15 @@
77

88
## What is the difference between this and ddev-solr
99

10-
Please consider using [ddev/ddev-solr](https://github.com/ddev/ddev-solr), which runs Solr in the modern "Cloud" mode. This offers several advantages. If you are using Drupal, the biggest advantage
11-
is that you can update the Solr Configset from the UI or with a Drush command everytime you update `search_api_solr`.
10+
[ddev/ddev-solr](https://github.com/ddev/ddev-solr) provides the Solr server. This module only adds drupal-specific convenience functions.
1211

13-
The current addon runs in "classic standalone" mode. It is probably simpler at first to setup, but comes with the added maintainance steps for configsets. Most Solr hosting service providers run "Solr Cloud" as a backend.
12+
## Migratiing from 1.x to 2.x
13+
14+
```bash
15+
ddev add-on get ddev/ddev-solr
16+
ddev add-on get ddev/ddev-drupal-solr
17+
ddev restart
18+
```
1419

1520
## Overview
1621

docker-compose.solr.yaml

Lines changed: 0 additions & 96 deletions
This file was deleted.

install.yaml

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,31 @@
1-
name: solr
1+
name: drupal-solr
22

3-
project_files:
4-
- solr/conf
5-
- solr/docker-entrypoint-initdb.d/solr-configupdate.sh
6-
- docker-compose.solr.yaml
3+
dependencies:
4+
- ddev/ddev-solr
75

8-
post_install_actions:
6+
# migrate from ddev-drupal-solr 1.x to ddev-solr
7+
pre_install_actions:
98
- |
10-
#ddev-description:Make sure solr-configupdate.sh is executable
11-
chmod +x solr/docker-entrypoint-initdb.d/solr-configupdate.sh
9+
if [ -d .ddev/solr/conf ]; then
10+
echo "Migrating core 'dev' to ddev-solr ..."
11+
if [ -d .ddev/solr/configsets/dev ]; then
12+
echo "Migration error: .ddev/solr/configsets/dev already exists."
13+
else
14+
echo "Moving ddev/solr/conf to .ddev/solr/configsets/dev/conf ..."
15+
mkdir .ddev/solr/configsets/dev
16+
mv .ddev/solr/conf .ddev/solr/configsets/dev/
17+
echo "Patching .ddev/solr/configsets/dev/conf/solrconfig* ..."
18+
for file in .ddev/solr/configsets/dev/conf/solrconfig*; do
19+
if [ -f "$file" ]; then
20+
cp "$file" "${file}.bak"
21+
sed -i '/<queryResponseWriter name="xslt" class="solr.XSLTResponseWriter">/,/<\/queryResponseWriter>/{/<\/queryResponseWriter>/!d;/<\/queryResponseWriter>/d;}' "$file"
22+
sed -i 's/LRUCache/CaffeineCache/g; s/LFUCache/CaffeineCache/g; s/FastLRUCache/CaffeineCache/g' "$file"
23+
fi
24+
done
25+
echo "Removing solr/docker-entrypoint-initdb.d ..."
26+
rm -rf solr/docker-entrypoint-initdb.d
27+
echo "... migration finished."
28+
fi
29+
fi
1230
1331
ddev_version_constraint: '>= v1.24.3'

solr/conf/accents_en.txt

Lines changed: 0 additions & 186 deletions
This file was deleted.

0 commit comments

Comments
 (0)