# Bypassing Ampache Update Page

**URL:** https://dietpi.com/forum/t/bypassing-ampache-update-page/17367
**Category:** Troubleshooting
**Created:** [19 July 2023 01:25 UTC](https://dietpi.com/forum/t/bypassing-ampache-update-page/17367 "2023-07-19T01:25:51Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![mostly\_offline](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/m/f6c823/32.png) [@mostly\_offline](https://dietpi.com/forum/u/mostly_offline)
#### Post date: [19 July 2023 01:25 UTC](https://dietpi.com/forum/t/bypassing-ampache-update-page/17367/1 "2023-07-19T01:25:51Z")

</div>

### Creating a bug report/issue

#### Required Information

- DietPi version | 8.19RC1
- Distro version | bullseye 1
- Kernel version | Linux DietPi 6.1.21+ #1642 Mon Apr 3 17:19:14 BST 2023 armv6l GNU/Linux
- Architecture | armhf
- SBC model | RPi Zero W (armv6l)
- Power supply used | 5V 1A
- SD card used | UHS 3 256GB SD Card

#### Additional Information (if applicable)

- Software title | Ampache
- Freshly installed
- This issue be replicated on a fresh installation of DietPi.

#### Steps to reproduce

- On DietPi:
  - Start a fresh install of DietPi on RPi Zero W.
  - ssh into root
  - complete setup without installing anything (basically leaving everything at default and not installing any software) and ssh out
  - ssh into dietpi
  - perform sudo dietpi-software to install Ampache with lighthttpd.

- On any other computer with browser on LAN:
  - Open ‘[https://XXX.XXX.XXX.XXX/ampache](https://XXX.XXX.XXX.XXX/ampache)’

#### Expected behaviour

Should be greated with Ampache setup or Login page

#### Actual behaviour

Webpage shows the following:

Ampache Update

This page handles all database updates to Ampache starting with **3.3.3.5**. Your current version is **5.6.2-release** with database version **5.0.0 Build: 003**

The following updates need to be performed:

#### Extra details

I tried performing config changes according to this post ([Ampache Changes](https://dietpi.com/forum/t/ampache-changes/6205)) from a year ago because the behaviour is similar but the problem still persists.

---

<div class="post-metadata">

### Author: ![mostly\_offline](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/m/f6c823/32.png) [@mostly\_offline](https://dietpi.com/forum/u/mostly_offline)
#### Post date: [19 July 2023 03:59 UTC](https://dietpi.com/forum/t/bypassing-ampache-update-page/17367/2 "2023-07-19T03:59:40Z")

</div>

I assume that this bug is because of the prebuilt Ampache database that is imported to the machine when performing `dietpi-software install`. The database is available here ([https://dietpi.com/downloads/mysql\_databases/ampache\_mysql\_3.8.2-v6.0.zip](https://dietpi.com/downloads/mysql_databases/ampache_mysql_3.8.2-v6.0.zip)).

The ampache database scheme has had several changes in schema ever since 3.8.2-v6.0. I wonder if those are to blame for breaking the software?

---

<div class="post-metadata">

### Author: ![Joulinar](https://dietpi.com/forum/user_avatar/dietpi.com/joulinar/32/57_2.png) [@Joulinar](https://dietpi.com/forum/u/Joulinar)
#### Post date: [19 July 2023 08:46 UTC](https://dietpi.com/forum/t/bypassing-ampache-update-page/17367/3 "2023-07-19T08:46:40Z")

</div>

Normally this is expected and it should be possible to update the database by clicking on the “Update” button at the bottom of the update page. But it looks like this does not work when we use our database dump actually.

![image](https://dietpi.com/forum/uploads/default/original/2X/6/67eeb332b85d81563e751f21f5daf0005aed451c.png)

Incidentally, Ampache itself does not provide a more up-to-date database dump either. However, it seems that using Ampache’s own dump allows the update:

```auto
cd /tmp
mysql -e "DROP DATABASE ampache;"
curl -sSfL https://raw.githubusercontent.com/ampache/ampache-debian/master/sql/ampache.sql -o ampache.sql
/boot/dietpi/func/create_mysql_db ampache ampache <your_db_password>
mysql ampache < ampache.sql
rm ampache.sql

```

You would need to replace `<your_db_password>` with the password configured within `ampache.cfg.php`. Can be checked as follow

```auto
cat /mnt/dietpi_userdata/ampache/config/ampache.cfg.php | grep database_password

```

Now, you should be able to open Ampache page again and perform the database update

---

<div class="post-metadata">

### Author: ![mostly\_offline](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/m/f6c823/32.png) [@mostly\_offline](https://dietpi.com/forum/u/mostly_offline)
#### Post date: [19 July 2023 09:56 UTC](https://dietpi.com/forum/t/bypassing-ampache-update-page/17367/4 "2023-07-19T09:56:08Z")

</div>

Can confirm this method works!

Additionally, it would be awesome if this method made it’s way to dietpi-software’s script so that it doesn’t rely upon a outdated database dump.

I am testing dietpi-software with the database url string changed but it currently seems inadequate.

---

<div class="post-metadata">

### Author: ![mostly\_offline](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/m/f6c823/32.png) [@mostly\_offline](https://dietpi.com/forum/u/mostly_offline)
#### Post date: [19 July 2023 10:13 UTC](https://dietpi.com/forum/t/bypassing-ampache-update-page/17367/5 "2023-07-19T10:13:28Z")

</div>

Also, the dietpi software docs stating that the username and passowrd to be ‘root’ and ‘dietpi’ is no longer true this way.

Neither does any user named ‘root’ or ’ dietpi’ exists.

However, using this link [http://XXX.XXX.XXX.XXX/ampache/install.php?action=show\_create\_account&htmllang=en\_US&charset=](http://XXX.XXX.XXX.XXX/ampache/install.php?action=show_create_account&htmllang=en_US&charset=) will work to create a new admin account!

---

<div class="post-metadata">

### Author: ![Joulinar](https://dietpi.com/forum/user_avatar/dietpi.com/joulinar/32/57_2.png) [@Joulinar](https://dietpi.com/forum/u/Joulinar)
#### Post date: [19 July 2023 11:00 UTC](https://dietpi.com/forum/t/bypassing-ampache-update-page/17367/6 "2023-07-19T11:00:24Z")

</div>

> [@mostly\_offline](#):
>
> Neither does any user named ‘root’ or ’ dietpi’ exists.

Yes, this is a small disadvantage because the workaround uses an empty database from Ampache. Therefore our user could not exist at all 😉

Need to talk to @MichaIng how we are going to work around.

---

<div class="post-metadata">

### Author: ![MichaIng](https://dietpi.com/forum/user_avatar/dietpi.com/michaing/32/7_2.png) [@MichaIng](https://dietpi.com/forum/u/MichaIng)
#### Post date: [20 July 2023 17:57 UTC](https://dietpi.com/forum/t/bypassing-ampache-update-page/17367/7 "2023-07-20T17:57:07Z")

</div>

So we need to update our database dump. Since on Buster Ampache v4.4.3 is installed, we probably need to provide two dumps, if the v4 dump cannot be upgraded to v5 either.

It’s nasty there there is not API to do the database changes. Doing it manually wouldn’t be maintainable due to the regular changes.

---

<div class="post-metadata">

### Author: ![Joulinar](https://dietpi.com/forum/user_avatar/dietpi.com/joulinar/32/57_2.png) [@Joulinar](https://dietpi.com/forum/u/Joulinar)
#### Post date: [22 July 2023 09:00 UTC](https://dietpi.com/forum/t/bypassing-ampache-update-page/17367/8 "2023-07-22T09:00:36Z")

</div>

@MichaIng

Probably a better option, we use the default Ampache SQL dump located at `/mnt/dietpi_userdata/ampache/resources/sql/ampache.sql` as base to build the databse initally. This way no DB update is needed at all 😉

Once done, user can open following link to create initial admin user.

- [http://192.168.0.x/ampache/install.php?action=show\_create\_account&htmllang=en\_US&charset=](http://192.168.0.x/ampache/install.php?action=show_create_account&htmllang=en_US&charset=)

Benefit, every user can create own user/password and we don’t use a default anymore. Furthermore, we don’t need to deal with maintaining the DB dump anymore. 😃

---

<div class="post-metadata">

### Author: ![MichaIng](https://dietpi.com/forum/user_avatar/dietpi.com/michaing/32/7_2.png) [@MichaIng](https://dietpi.com/forum/u/MichaIng)
#### Post date: [22 July 2023 16:23 UTC](https://dietpi.com/forum/t/bypassing-ampache-update-page/17367/9 "2023-07-22T16:23:06Z")

</div>

Probably you are right. The only other thing we might want to adjust is the music directory, but this can be done safely via `sed` on the SQL file, I guess.

---

<div class="post-metadata">

### Author: ![Joulinar](https://dietpi.com/forum/user_avatar/dietpi.com/joulinar/32/57_2.png) [@Joulinar](https://dietpi.com/forum/u/Joulinar)
#### Post date: [24 October 2023 15:00 UTC](https://dietpi.com/forum/t/bypassing-ampache-update-page/17367/10 "2023-10-24T15:00:53Z")

</div>

@MichaIng I’m not sure but I guess we never finished this discussion? right?

---

<div class="post-metadata">

### Author: ![MichaIng](https://dietpi.com/forum/user_avatar/dietpi.com/michaing/32/7_2.png) [@MichaIng](https://dietpi.com/forum/u/MichaIng)
#### Post date: [26 November 2023 19:37 UTC](https://dietpi.com/forum/t/bypassing-ampache-update-page/17367/11 "2023-11-26T19:37:29Z")

</div>

PR up to fix this: [DietPi-Software | Ampache: Fix for Ampache v6 on Bullseye and Bookworm by MichaIng · Pull Request #6782 · MichaIng/DietPi · GitHub](https://github.com/MichaIng/DietPi/pull/6782)
