Wordpress Plugins Permissions Errors

Hi, I’m trying to setup a WP instance and i’m having troubles with plugins.
I need to use an Import plugin ( I currently do not have access to cpanel or ftp ).
I installed the plugin in this way:

  wpMigration = pkgs.stdenv.mkDerivation {
    name = "wordpress-all-in-one-migration";
    src = pkgs.fetchurl {
      url = https://downloads.wordpress.org/plugin/all-in-one-wp-migration.7.53.zip;
      sha256 = "04hhcakv84saag3ccj445p20kmy357ci7gz5kpyp45iqw8wr252a";

    buildInputs = [ pkgs.unzip ];
    installPhase = "mkdir -p $out; cp -R * $out/";

And seems to be installed correctly, but when i’m trying to use it, i get a bunch of errors like this:

All-in-One WP Migration is not able to create /nix/store/y3m0lxgc191zhw2pgc8j0cxkzh3zng80-wordpress-test-5.8.3/share/wordpress/wp-content/ai1wm-backups folder. You will need to create this folder and grant it read/write/execute permissions (0777) for the All-in-One WP Migration plugin to function properly. 

Site could not be exported

Please make sure that storage directory /nix/store/y3m0lxgc191zhw2pgc8j0cxkzh3zng80-wordpress-test-5.8.3/share/wordpress/wp-content/plugins/wordpress-all-in-one-migration/storage has read and write permissions.

Technical details

Wp is configured in this way:

    wordpress.sites."test" = {
        database = {
          createLocally = true;
        plugins = [ wpMigration ];
        virtualHost = {
          adminAddr = "foo@example.com";
          serverAliases = [ "webservice5" "www.webservice5" ];

Any ideas?

On NixOS, WordPress runs on a read-only directory, with the exception of the uploads folder. WordPress is not accustomed to that kind of environment, so expect to face some challenges.

If the plugin you are using doesn’t have a way to configure the backup directory, you will have to patch the source code (using your package) to write the backups elsewhere. If you add an attribute (ex. backupDir) to your package, then you can use that to configure the path:

plugins = [ (myplugin.override { backupDir = “/some/path/WordPress/can/write/to”; }) ]

@emmanuelrosa Thanks for the clarification :smiley:
Will try to patch it.