Skip to content

Commit 05c6d03

Browse files
committed
prepared migration script
1 parent 124c5df commit 05c6d03

23 files changed

+35
-19857
lines changed

README.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,15 @@
22

33
## What is the difference between this and ddev-solr
44

5-
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
6-
is that you can update the Solr Configset from the UI or with a Drush command everytime you update search_api_solr.
5+
[ddev/ddev-solr](https://github.com/ddev/ddev-solr) provides the Solr server. This module only adds drupal-specific convenience functions.
76

8-
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"
9-
as a backend.
7+
## Migratiing from 1.x to 2.x
8+
9+
```shell
10+
ddev get ddev/ddev-solr
11+
ddev get ddev/ddev-drupal-solr
12+
ddev restart
13+
```
1014

1115
## What is this?
1216

docker-compose.solr.yaml

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

install.yaml

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,34 @@
1-
name: solr
1+
name: drupal-solr
22

3+
dependencies:
4+
- ddev/ddev-solr
5+
6+
# migrate from ddev-drupal-solr 1.x to ddev-solr
37
pre_install_actions:
8+
- |
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
430
531
# files and directories listed here are copied into .ddev
632
project_files:
7-
- solr/conf
8-
- solr/docker-entrypoint-initdb.d/solr-configupdate.sh
9-
- docker-compose.solr.yaml
1033

1134
post_install_actions:
12-
- |
13-
#ddev-description:Make sure solr-configupdate.sh is executable
14-
chmod +x solr/docker-entrypoint-initdb.d/solr-configupdate.sh

solr/conf/accents_en.txt

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

0 commit comments

Comments
 (0)