Upgrade Guide
=================

# Ginger v3.*

Starting with version 3 Ginger uses an elastic search index to store and find Log entries.

### Prerequisite
An Elastic Search Engine must be available

### CAUTION!

**If you want to upgrade the bundle to `v3.*` from within a symfony application that already has real data at it´s disposal, be aware that you will have to migrate some of your database tables!**

### ATTENTION!

When making changes to the database of a production system, **ALWAYS BE SURE TO HAVE A BACKUP OF YOUR DATABASE** before proceeding
with the following steps!!!

#### Step 1: Configure a unique (for that ES Engine) index-Prefix in .env:
```
# .env
ES_POSTFIX=myinstance
```
#### Step 2: Rename Table ginger_ext_log_entry TO ginger_ext_log_entry_legacy 

#### Step 3: Update Doctrine schema
```
php bin/console d:s:u --force
```

#### Step 4: Migrate old logs to new AdminLogEnities
This might take a few minutes
```
php bin/console ginger:migrate-logs --env=prod
```

#### Step 5: Populate Elastic search index for DEV (optional but useful):
```
php bin/console fos:elastica:populate --env=dev
```