• Resolved Shahriar Kabir

    (@smshahriar)


    I have some folders where I have some archive files like .zip file (20gb in size). Now I want to migrate the site to my localhost or to another host just to test something by using your All in One Migration plugin. Now is there any way to skip those folder when I will hit the Export button in the plugin? Thanks in advance.

Viewing 12 replies - 1 through 12 (of 12 total)
  • Plugin Author Yani

    (@yaniiliev)

    @smshahriar

    It is not possible to files other than media/plugins/themes.

    Thread Starter Shahriar Kabir

    (@smshahriar)

    Ah, the plugin is so great. It seems an obvious option even if it’s paid.

    Actually, it is possible to exclude a folder on your export, you just need to use the ‘ai1wm_exclude_content_from_export’ filter.

    Just add the following code in your theme’s functions.php:

    add_filter( 'ai1wm_exclude_content_from_export', function( $exclude ) {
    	$exclude[] = 'cache';
    	return $exclude;
    } );

    Just change ‘cache’ to the ‘folder name’ you want to exclude.

    I’ve been using this filter for ages because the plugin indiscriminately includes all folders in the wp-content folder without an easy way to exclude them via the Advanced Options.

    Thread Starter Shahriar Kabir

    (@smshahriar)

    @systemfailer thank you very much. So if I have multiple folders to exclude, can I simply use the below code?

    add_filter( 'ai1wm_exclude_content_from_export', function( $exclude ) {
    	$exclude[] = 'cache1';
            $exclude[] = 'cache2';
    	return $exclude;
    } );

    Can someone able to create a plugin on this filter through which we can easily exclude the folders by installing that plugin?

    @smshahriar Yes, that is correct.

    @zeeshanx Should be possible. Wish I have enough time to write it though ?? Somebody else should be able to do so.

    Thread Starter Shahriar Kabir

    (@smshahriar)

    @systemfailer thanks again. So the code will exclude the folders which are inside /wp-content directory. But what’s about when you want to exclude folder in the root directory which are not inside in /wp-content ?

    @smshahriar The plugin does not backup folders above wp-content/ but inside wp-content/ it should be relative to that folder, so you can use $exclude[] = 'plugins/akismet/storage';
    or
    $exclude[] = 'themes/avada/includes';

    I haven’t tried it yet though but it should work.

    • This reply was modified 6 years, 5 months ago by SystemFailer.
    • This reply was modified 6 years, 5 months ago by SystemFailer.
    Thread Starter Shahriar Kabir

    (@smshahriar)

    @systemfailer The problem is that I have some folders where I have some archive files which are outside of the /wp-content directory in some folders. I need a way to exclude those folders. Is it possible?

    @smshahriar As far as I know, the plugin only exports files inside wp-content/

    But if it is for you, you can try

    $exclude[] = '../wp-admin/includes';
    $exclude[] = '../outsidefolder';
    Thread Starter Shahriar Kabir

    (@smshahriar)

    @systemfailer Great, thank you. I will give it a try.

    Anyway yes I know the plugin only exports files inside wp-content. But I was talking about the files and folders which are uploaded through FTP manually or the folders from the other plugins which stays outside of the wp-content directory.

    I’ve created a plugin for this: https://github.com/anonymousguyx/ai1wpm-excluder

    It’s an open source plugin and any one can contribute for improving it’s functionality ??

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘How to skip a directory during creating a backup’ is closed to new replies.