# FileWave Server Repair Permissions

## What

When [migrating a server](https://kb.filewave.com/books/filewave-server/page/migrating-your-on-premise-filewave-server-to-new-hardware "Migrating your On-Premise FileWave Server to new Hardware") or simply moving files around or trying to [restore from a backup](https://kb.filewave.com/books/filewave-server/page/filewave-server-backup-and-restore "FileWave Server Backup") you can inadvertently set the ownership or permissions incorrectly on the FileWave Server. This can lead to services not starting or the database being inaccessible until it is corrected.

## When/Why

You would use the included script when doing any migration or restore process or any time you think you may have changed the permissions.

## How

From FileWave 15.5.0 onward this is accomplished by a simple command and you do not need to follow any other steps. The command is below and you can paste it in to an SSH or Terminal session;

```shell
sudo /usr/local/filewave/python/bin/python /usr/local/filewave/django/manage.pyc set_fwxserver_permissions_and_ownership
```

After this you should restart FileWave now that the permissions are correct.

```shell
sudo fwcontrol server restart
```

For older versions of FileWave older than 15.5.0 the following legacy documentation and script is maintained:

<details id="bkmrk-pre-filewave-15.5.0-"><summary>Pre FileWave 15.5.0</summary>

There are multiple versions of this script from changes over time. As mentioned earlier in this article, from 15.5.0 and beyond the scripts below are not needed because a built in command was added.

<p class="callout danger">When you run this script you must stop the FileWave Server so that none of the files are locked. This is easily done with "sudo fwcontrol server stop" to make sure it is stopped. </p>

<p class="callout info">You can copy the link to the file from below and do "<span class="ui-provider a b c d e f g h i j k l m n o p q r s t u v w x y z ab ac ae af ag ah ai aj ak" dir="ltr">`wget <a aria-label="Link https://kb.filewave.com/attachments/283" class="fui-Link ___1rxvrpe f2hkw1w f3rmtva f1ewtqcl fyind8e f1k6fduh f1w7gpdv fk6fouc fjoy568 figsok6 f1hu3pq6 f11qmguv f19f4twv f1tyq0we f1g0x7ka fhxju0i f1qch9an f1cnd47f fqv5qza f1vmzxwi f1o700av f13mvf36 f1cmlufx f9n3di6 f1ids18y f1tx3yz7 f1deo86v f1eh06m1 f1iescvh fhgqx19 f1olyrje f1p93eir f1nev41a f1h8hb77 f1lqvz6u f10aw75t fsle3fq f17ae5zn" href="https://kb.filewave.com/attachments/283" rel="noreferrer noopener" target="_blank" title="https://kb.filewave.com/attachments/283">https://kb.filewave.com/attachments/283</a>`" for instance for the Debian script and then just unzip it. "`unzip ./283`" to unzip the script. Planned for a release in 2024 there will be a simple management command included with FileWave Server that has this a built in function. </span></p>

[Fix Permissions FileWave 15+ (Debian)](https://kb.filewave.com/attachments/283) | [Fix Permissions FileWave 14+ (macOS/CentOS)](https://kb.filewave.com/attachments/284)   
  
If you are on an older version of FileWave use of these instead:  
[Fix Permissions v13.1.5+](https://kb.filewave.com/attachments/282) | [Fix Permissions v13.1.4 or older](https://kb.filewave.com/attachments/285)  
  
You can use wget to download the correct script and then rename it to anything.zip if it didn't get a .zip name and unzip it. You will need to give the script 755 permissions to run it. You will run the command to the path to the script. For the example it is in the current folder we are in so we use ./ before the name.

`sudo chmod 755 ./fixfwxserverPermissions15.sh`

Then you will need to run the script.

`sudo ./fixfwxserverPermissions15Debian.sh`

After it fixes permissions you will want to restart your FileWave Server.

`fwcontrol server restart`


</details>## Related Content

- [Migrating your On-Premise FileWave Server to new Hardware](https://kb.filewave.com/books/filewave-server/page/migrating-your-on-premise-filewave-server-to-new-hardware "Migrating your On-Premise FileWave Server to new Hardware")
- [FileWave Server Backup](https://kb.filewave.com/books/filewave-server/page/filewave-server-backup-and-restore "FileWave Server Backup")