# CSRF failure after backup and restore

**URL:** https://community.zammad.org/t/csrf-failure-after-backup-and-restore/4156
**Category:** Technical assistance
**Created:** [March 4, 2020, 6:15pm UTC](https://community.zammad.org/t/csrf-failure-after-backup-and-restore/4156 "2020-03-04T18:15:23Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![SimonO](https://community.zammad.org/letter_avatar_proxy/v4/letter/s/e19adc/32.png) [@SimonO](https://community.zammad.org/u/SimonO)
#### Post date: [March 4, 2020, 6:15pm UTC](https://community.zammad.org/t/csrf-failure-after-backup-and-restore/4156/1 "2020-03-04T18:15:23Z")

</div>

### Infos:

- Used Zammad version: 3.2
- Used Zammad installation source: DEB
- Operating system: Ubuntu
- Browser + version: Chrome 80.0.3987.122

### Expected behavior:

- I am trying to move my Zammad system to a new server

### Actual behavior:

- Did a backup on old server as described here: [backup and restore](https://docs.zammad.org/en/latest/appendix/backup-and-restore.html)
- Set up a new server with a new Zammad system
- Restored old data
- Got a CSRF failure
- Assigned old IP and domain to new server
- Still got a CSRF failure 😉

Sorry for opening a new post, this would perfectly fit [in here](https://community.zammad.org/t/fresh-install-3-2-x-csrf-token-verification-failed/3080) but that post was closed while I was typing :-/

Thanks for any help,  
best regards,  
Simon

This is my zammad.conf:

> # 
> 
> # this is the nginx config for zammad
> 
> # 
> 
> upstream zammad {  
> server localhost:3000;  
> }
> 
> upstream zammad-websocket {  
> server localhost:6042;  
> }
> 
> # Added - Automatically redirect HTTP to HTTPS Nginx
> 
> server {  
> listen 80;  
> server\_name [my.domain.de](http://my.domain.de);  
> return 301 https://$host$request\_uri;  
> }
> 
> # Added - HTTPS configuration for Zammad
> 
> server {  
> listen 443 http2 ssl;
> 
> ssl\_certificate /etc/letsencrypt/live/my.domain.de/fullchain.pem;  
> ssl\_certificate\_key /etc/letsencrypt/live/my.domain.de/privkey.pem;  
> ssl\_protocols TLSv1 TLSv1.1 TLSv1.2;  
> ssl\_prefer\_server\_ciphers on;  
> ssl\_ciphers “EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH”;  
> ssl\_ecdh\_curve secp384r1;  
> ssl\_session\_cache shared:SSL:10m;  
> ssl\_session\_tickets off;  
> ssl\_stapling on;  
> ssl\_stapling\_verify on;  
> resolver 8.8.8.8 8.8.4.4 valid=300s;  
> resolver\_timeout 5s;  
> add\_header Strict-Transport-Security “max-age=63072000; includeSubdomains”;  
> add\_header X-Frame-Options DENY;  
> add\_header X-Content-Type-Options nosniff;
> 
> # replace ‘localhost’ with your fqdn/domain name if you want to use zammad from remote
> 
> server\_name [my.domain.de](http://my.domain.de);
> 
> root /opt/zammad/public;
> 
> access\_log /var/log/nginx/zammad.access.log;  
> error\_log /var/log/nginx/zammad.error.log;
> 
> client\_max\_body\_size 50M;
> 
> location ~ ^/(assets/|robots.txt|humans.txt|favicon.ico) {  
> expires max;  
> }
> 
> location /ws {  
> proxy\_http\_version 1.1;  
> proxy\_set\_header Upgrade $http\_upgrade;  
> proxy\_set\_header Connection “Upgrade”;  
> proxy\_set\_header CLIENT\_IP $remote\_addr;  
> proxy\_set\_header X-Forwarded-For $proxy\_add\_x\_forwarded\_for;  
> proxy\_read\_timeout 86400;  
> proxy\_pass [http://zammad-websocket](http://zammad-websocket);  
> }
> 
> location / {  
> proxy\_set\_header Host $http\_host;  
> proxy\_set\_header CLIENT\_IP $remote\_addr;  
> proxy\_set\_header X-Forwarded-For $proxy\_add\_x\_forwarded\_for;  
> proxy\_read\_timeout 180;  
> proxy\_pass [http://zammad](http://zammad);
> 
> gzip on;  
> gzip\_types text/plain text/xml text/css image/svg+xml application/javascript application/x-javascript application/json application/xml;  
> gzip\_proxied any;  
> }  
> }

---

<div class="post-metadata">

### Author: ![MrGeneration](https://community.zammad.org/user_avatar/community.zammad.org/mrgeneration/32/9260_2.png) [@MrGeneration](https://community.zammad.org/u/MrGeneration)
#### Post date: [March 5, 2020, 12:21am UTC](https://community.zammad.org/t/csrf-failure-after-backup-and-restore/4156/2 "2020-03-05T00:21:12Z")

</div>

Please have a look at this thread, it will solve your issue:

> [@Zammad 3.2 is available](https://community.zammad.org/t/zammad-3-2-is-available/3656):
>
> Better late than never: As most of you already noticed - Zammad 3.2 is out. 1. Big changes 1.1 Performance This release brings great performance optimisations. Not just good for your CPU load but also affects the memory consumption of Zammad which saves up to 38% memory (in comparison to earlier versions) in long time run. 1.2 Chat enhancements 3.2 comes with several enhancements for the Chat function: You can now disable the display of the agents Avatar and even define a custom display nam…

---

<div class="post-metadata">

### Author: ![SimonO](https://community.zammad.org/letter_avatar_proxy/v4/letter/s/e19adc/32.png) [@SimonO](https://community.zammad.org/u/SimonO)
#### Post date: [March 7, 2020, 2:58pm UTC](https://community.zammad.org/t/csrf-failure-after-backup-and-restore/4156/3 "2020-03-07T14:58:42Z")

</div>

Thank you very much! I figured it out now.  
But here is the next problem:  
Everything is restored, I did

> zammad run rake searchindex:rebuild

but I am not able to login, this is the error I get:  
 ![2020-03-07](https://community.zammad.org/uploads/default/original/2X/f/fdfde8f8c7c4c064bef63c69f12bf10ac0f5acd7.png)  
Requesting a new password does not work either.

Any ideas?  
Thanks in advance 😉  
Simon

---

<div class="post-metadata">

### Author: ![MrGeneration](https://community.zammad.org/user_avatar/community.zammad.org/mrgeneration/32/9260_2.png) [@MrGeneration](https://community.zammad.org/u/MrGeneration)
#### Post date: [March 9, 2020, 11:06am UTC](https://community.zammad.org/t/csrf-failure-after-backup-and-restore/4156/4 "2020-03-09T11:06:42Z")

</div>

> [@SimonO](#):
>
> but I am not able to login, this is the error I get:  
> ![2020-03-07](https://community.zammad.org/uploads/default/original/2X/f/fdfde8f8c7c4c064bef63c69f12bf10ac0f5acd7.png)  
> Requesting a new password does not work either.
> 
> Any ideas?

Please don’t mix topics.  
Lookup the provided ID with a friendly grep in your production log.

These error ids are generated randomly and have no real connection to learn what went wrong.

---

<div class="post-metadata">

### Author: ![SimonO](https://community.zammad.org/letter_avatar_proxy/v4/letter/s/e19adc/32.png) [@SimonO](https://community.zammad.org/u/SimonO)
#### Post date: [March 9, 2020, 5:06pm UTC](https://community.zammad.org/t/csrf-failure-after-backup-and-restore/4156/5 "2020-03-09T17:06:28Z")

</div>

Hehe, thanks for the hint. It shows that I am not mixing topics, but that was lucky 😉

> [2020-03-07T14:49:42.690917 #2136-47063552666340] ERROR – : Error ID cSlzkeB p: CSRF token verification failed!

That error haunts me…

---

<div class="post-metadata">

### Author: ![SimonO](https://community.zammad.org/letter_avatar_proxy/v4/letter/s/e19adc/32.png) [@SimonO](https://community.zammad.org/u/SimonO)
#### Post date: [March 9, 2020, 6:22pm UTC](https://community.zammad.org/t/csrf-failure-after-backup-and-restore/4156/6 "2020-03-09T18:22:21Z")

</div>

Fixed it.  
What I did:

1.: Go to the old system.  
2.: Find this in settings:

 ![https](https://community.zammad.org/uploads/default/original/2X/b/b97d4fcfe83537c5b178def8261f9667fc1b92d4.png)  
It was set to “https”, that was the mistake. Set it to “http”.  
3. Do the backup  
4. Restore on new server.  
5. Get a beer.

=)

---

<div class="post-metadata">

### Author: ![MrGeneration](https://community.zammad.org/user_avatar/community.zammad.org/mrgeneration/32/9260_2.png) [@MrGeneration](https://community.zammad.org/u/MrGeneration)
#### Post date: [March 10, 2020, 9:58am UTC](https://community.zammad.org/t/csrf-failure-after-backup-and-restore/4156/7 "2020-03-10T09:58:43Z")

</div>

Glad you could solve it.  
I see flaws in your list thoguh.

DId you mean:

```auto
[...]
3. Do the backup
4. Get a beer.
5. Restore on new server.
6. Get a beer.

```

? 😉

---

<div class="post-metadata">

### Author: ![system](https://community.zammad.org/uploads/default/original/1X/5c5afaea2d23f811dbec33cd4edb02fa29d3262f.png) [@system](https://community.zammad.org/u/system)
#### Post date: [July 8, 2020, 9:58am UTC](https://community.zammad.org/t/csrf-failure-after-backup-and-restore/4156/8 "2020-07-08T09:58:46Z")

</div>

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.
